mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-06-08 16:21:32 +00:00
Move missing-builds/cruft to excuses
Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
parent
7b8b9e8258
commit
1028860c53
18
britney.py
18
britney.py
@ -1340,12 +1340,10 @@ class Britney(object):
|
|||||||
|
|
||||||
if arch in self.options.fucked_arches:
|
if arch in self.options.fucked_arches:
|
||||||
text = text + " (but %s isn't keeping up, so never mind)" % (arch)
|
text = text + " (but %s isn't keeping up, so never mind)" % (arch)
|
||||||
|
excuse.missing_build_on_ood_arch(arch)
|
||||||
else:
|
else:
|
||||||
update_candidate = False
|
update_candidate = False
|
||||||
excuse.addreason("arch")
|
excuse.missing_build_on_arch(arch)
|
||||||
excuse.addreason("arch-%s" % arch)
|
|
||||||
excuse.addreason("build-arch")
|
|
||||||
excuse.addreason("build-arch-%s" % arch)
|
|
||||||
|
|
||||||
excuse.addhtml(text)
|
excuse.addhtml(text)
|
||||||
|
|
||||||
@ -1372,6 +1370,7 @@ class Britney(object):
|
|||||||
if pkgsv not in oodbins:
|
if pkgsv not in oodbins:
|
||||||
oodbins[pkgsv] = []
|
oodbins[pkgsv] = []
|
||||||
oodbins[pkgsv].append(pkg)
|
oodbins[pkgsv].append(pkg)
|
||||||
|
excuse.add_old_binary(pkg, pkgsv)
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
# if the binary is arch all, it doesn't count as
|
# 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:
|
if arch in self.options.fucked_arches:
|
||||||
text = text + " (but %s isn't keeping up, so nevermind)" % (arch)
|
text = text + " (but %s isn't keeping up, so nevermind)" % (arch)
|
||||||
|
if not uptodatebins:
|
||||||
|
excuse.missing_build_on_ood_arch(arch)
|
||||||
else:
|
else:
|
||||||
if uptodatebins:
|
if uptodatebins:
|
||||||
excuse.addreason("cruft-arch")
|
|
||||||
excuse.addreason("cruft-arch-%s" % arch)
|
|
||||||
if self.options.ignore_cruft:
|
if self.options.ignore_cruft:
|
||||||
text = text + " (but ignoring cruft, so nevermind)"
|
text = text + " (but ignoring cruft, so nevermind)"
|
||||||
else:
|
else:
|
||||||
update_candidate = False
|
update_candidate = False
|
||||||
excuse.addreason("arch")
|
|
||||||
excuse.addreason("arch-%s" % arch)
|
|
||||||
else:
|
else:
|
||||||
update_candidate = False
|
update_candidate = False
|
||||||
excuse.addreason("arch")
|
excuse.missing_build_on_arch(arch)
|
||||||
excuse.addreason("arch-%s" % arch)
|
|
||||||
excuse.addreason("build-arch")
|
|
||||||
excuse.addreason("build-arch-%s" % arch)
|
|
||||||
|
|
||||||
if 'age' in policy_info and policy_info['age']['current-age']:
|
if 'age' in policy_info and policy_info['age']['current-age']:
|
||||||
excuse.addhtml(text)
|
excuse.addhtml(text)
|
||||||
|
24
excuse.py
24
excuse.py
@ -14,8 +14,10 @@
|
|||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
from collections import defaultdict
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
||||||
class Excuse(object):
|
class Excuse(object):
|
||||||
"""Excuse class
|
"""Excuse class
|
||||||
|
|
||||||
@ -59,6 +61,9 @@ class Excuse(object):
|
|||||||
self.oldbugs = set()
|
self.oldbugs = set()
|
||||||
self.reason = {}
|
self.reason = {}
|
||||||
self.htmlline = []
|
self.htmlline = []
|
||||||
|
self.missing_builds = set()
|
||||||
|
self.missing_builds_ood_arch = set()
|
||||||
|
self.old_binaries = defaultdict(set)
|
||||||
self.policy_info = {}
|
self.policy_info = {}
|
||||||
|
|
||||||
def sortkey(self):
|
def sortkey(self):
|
||||||
@ -130,6 +135,18 @@ class Excuse(object):
|
|||||||
"""Add a note in HTML"""
|
"""Add a note in HTML"""
|
||||||
self.htmlline.append(note)
|
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):
|
def html(self):
|
||||||
"""Render the excuse in HTML"""
|
"""Render the excuse in HTML"""
|
||||||
res = "<a id=\"%s\" name=\"%s\">%s</a> (%s to %s)\n<ul>\n" % \
|
res = "<a id=\"%s\" name=\"%s\">%s</a> (%s to %s)\n<ul>\n" % \
|
||||||
@ -214,6 +231,13 @@ class Excuse(object):
|
|||||||
excusedata['component'] = self.section.split('/')[0]
|
excusedata['component'] = self.section.split('/')[0]
|
||||||
if self.policy_info:
|
if self.policy_info:
|
||||||
excusedata['policy_info'] = self.policy_info
|
excusedata['policy_info'] = self.policy_info
|
||||||
|
if self.missing_builds or self.missing_builds_ood_arch:
|
||||||
|
excusedata['missing-builds'] = {
|
||||||
|
'on-architectures': sorted(self.missing_builds),
|
||||||
|
'on-unimportant-architectures': sorted(self.missing_builds_ood_arch),
|
||||||
|
}
|
||||||
|
if self.old_binaries:
|
||||||
|
excusedata['old-binaries'] = {x: sorted(self.old_binaries[x]) for x in self.old_binaries}
|
||||||
if self.forced:
|
if self.forced:
|
||||||
excusedata["forced-reason"] = sorted(list(self.reason.keys()))
|
excusedata["forced-reason"] = sorted(list(self.reason.keys()))
|
||||||
excusedata["reason"] = []
|
excusedata["reason"] = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user