From b395c6f760a73523548a3df0b1952318ba12827e Mon Sep 17 00:00:00 2001 From: Ivo De Decker Date: Tue, 1 Jan 2019 10:28:17 +0000 Subject: [PATCH] Only ignore hints for the same package if arch matches Signed-off-by: Ivo De Decker --- britney.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/britney.py b/britney.py index 58ec8a0..3bf914f 100755 --- a/britney.py +++ b/britney.py @@ -703,29 +703,30 @@ class Britney(object): hints = self._hint_parser.hints for x in ["block", "block-all", "block-udeb", "unblock", "unblock-udeb", "force", "urgent", "remove", "age-days"]: - z = {} + z = defaultdict(dict) for hint in hints[x]: package = hint.package + architecture = hint.architecture key = (hint, hint.user) - if package in z and z[package] != key: - hint2 = z[package][0] + if package in z and architecture in z[package] and z[package][architecture] != key: + hint2 = z[package][architecture][0] if x in ['unblock', 'unblock-udeb']: if apt_pkg.version_compare(hint2.version, hint.version) < 0: # This hint is for a newer version, so discard the old one - self.logger.warning("Overriding %s[%s] = ('%s', '%s') with ('%s', '%s')", - x, package, hint2.version, hint2.user, hint.version, hint.user) + self.logger.warning("Overriding %s[%s] = ('%s', '%s', '%s') with ('%s', '%s', '%s')", + x, package, hint2.version, hint2.architecture, hint2.user, hint.version, hint.architecture, hint.user) hint2.set_active(False) else: # This hint is for an older version, so ignore it in favour of the new one - self.logger.warning("Ignoring %s[%s] = ('%s', '%s'), ('%s', '%s') is higher or equal", - x, package, hint.version, hint.user, hint2.version, hint2.user) + self.logger.warning("Ignoring %s[%s] = ('%s', '%s', '%s'), ('%s', '%s', '%s') is higher or equal", + x, package, hint.version, hint.architecture, hint.user, hint2.version, hint2.architecture, hint2.user) hint.set_active(False) else: self.logger.warning("Overriding %s[%s] = ('%s', '%s') with ('%s', '%s')", x, package, hint2.user, hint2, hint.user, hint) hint2.set_active(False) - z[package] = key + z[package][architecture] = key # Sanity check the hints hash if len(hints["block"]) == 0 and len(hints["block-udeb"]) == 0: