diff --git a/britney.py b/britney.py index cc82b47..f602745 100755 --- a/britney.py +++ b/britney.py @@ -1340,12 +1340,10 @@ class Britney(object): if arch in self.options.fucked_arches: text = text + " (but %s isn't keeping up, so never mind)" % (arch) + excuse.missing_build_on_ood_arch(arch) else: update_candidate = False - excuse.addreason("arch") - excuse.addreason("arch-%s" % arch) - excuse.addreason("build-arch") - excuse.addreason("build-arch-%s" % arch) + excuse.missing_build_on_arch(arch) excuse.addhtml(text) @@ -1372,6 +1370,7 @@ class Britney(object): if pkgsv not in oodbins: oodbins[pkgsv] = [] oodbins[pkgsv].append(pkg) + excuse.add_old_binary(pkg, pkgsv) continue else: # if the binary is arch all, it doesn't count as @@ -1405,22 +1404,17 @@ class Britney(object): if arch in self.options.fucked_arches: text = text + " (but %s isn't keeping up, so nevermind)" % (arch) + if not uptodatebins: + excuse.missing_build_on_ood_arch(arch) else: if uptodatebins: - excuse.addreason("cruft-arch") - excuse.addreason("cruft-arch-%s" % arch) if self.options.ignore_cruft: text = text + " (but ignoring cruft, so nevermind)" else: update_candidate = False - excuse.addreason("arch") - excuse.addreason("arch-%s" % arch) else: update_candidate = False - excuse.addreason("arch") - excuse.addreason("arch-%s" % arch) - excuse.addreason("build-arch") - excuse.addreason("build-arch-%s" % arch) + excuse.missing_build_on_arch(arch) if 'age' in policy_info and policy_info['age']['current-age']: excuse.addhtml(text) diff --git a/excuse.py b/excuse.py index e338f06..e1da7c3 100644 --- a/excuse.py +++ b/excuse.py @@ -14,8 +14,10 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. +from collections import defaultdict import re + class Excuse(object): """Excuse class @@ -59,6 +61,9 @@ class Excuse(object): self.oldbugs = set() self.reason = {} self.htmlline = [] + self.missing_builds = set() + self.missing_builds_ood_arch = set() + self.old_binaries = defaultdict(set) self.policy_info = {} def sortkey(self): @@ -130,6 +135,18 @@ class Excuse(object): """Add a note in HTML""" self.htmlline.append(note) + def missing_build_on_arch(self, arch): + """Note that the item is missing a build on a given architecture""" + self.missing_builds.add(arch) + + def missing_build_on_ood_arch(self, arch): + """Note that the item is missing a build on a given "out of date" architecture""" + self.missing_builds.add(arch) + + def add_old_binary(self, binary, from_source_version): + """Denote than an old binary ("cruft") is available from a previous source version""" + self.old_binaries[from_source_version].add(binary) + def html(self): """Render the excuse in HTML""" res = "%s (%s to %s)\n