From e605091f24ebce59a1002050ffa412508338d74f Mon Sep 17 00:00:00 2001 From: "Adam D. Barratt" Date: Tue, 25 Dec 2012 18:28:14 +0000 Subject: [PATCH] Fix excuse invalidation checks for arch-specific dependencies A dependency on an arch-specific package which is not a valid candidate should lead to the depending package not being a candidate. For now we ensure that the generated excuses output remains the same, so that we don't have to wait for consumers to adapt to a new format. Changing the output format should be revisited at a later point. See Debian bug #693068. Signed-off-by: Adam D. Barratt --- britney.py | 5 ++++- excuse.py | 10 +++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/britney.py b/britney.py index ea98a60..3c56e07 100755 --- a/britney.py +++ b/britney.py @@ -1084,7 +1084,10 @@ class Britney(object): # for the solving packages, update the excuse to add the dependencies for p in packages: if arch not in self.options.break_arches.split(): - excuse.add_dep(p, arch) + if p in self.sources['testing'] and self.sources['testing'][p][VERSION] == self.sources[suite][p][VERSION]: + excuse.add_dep("%s/%s" % (p, arch), arch) + else: + excuse.add_dep(p, arch) else: excuse.add_break_dep(p, arch) diff --git a/excuse.py b/excuse.py index 9f459d0..7cc7ebb 100644 --- a/excuse.py +++ b/excuse.py @@ -135,11 +135,15 @@ class Excuse(object): (self.daysold, self.mindays)) for x in self.htmlline: res = res + "
  • " + x + "\n" - for x in sorted(self.deps): + lastdep = "" + for x in sorted(self.deps, lambda x,y: cmp(x.split('/')[0], y.split('/')[0])): + dep = x.split('/')[0] + if dep == lastdep: continue + lastdep = dep if x in self.invalid_deps: - res = res + "
  • Depends: %s %s (not considered)\n" % (self.name, x, x) + res = res + "
  • Depends: %s %s (not considered)\n" % (self.name, dep, dep) else: - res = res + "
  • Depends: %s %s\n" % (self.name, x, x) + res = res + "
  • Depends: %s %s\n" % (self.name, dep, dep) for (n,a) in self.break_deps: if n not in self.deps: res += "
  • Ignoring %s depends: %s\n" % (a, n, n)