Handle Build-Depends-Indep in excuses

Admittedly, no policy adds them yet so this is currently no-op code.
However, future commits can start to rely on this infrastructure code.

Signed-off-by: Niels Thykier <niels@thykier.net>
ubuntu/rebased
Niels Thykier 7 years ago
parent 1623828a48
commit 0d5c4a24c4

@ -78,6 +78,7 @@ class Excuse(object):
self.invalid_build_deps = set()
self.deps = {}
self.arch_build_deps = {}
self.indep_build_deps = {}
self.sane_deps = []
self.break_deps = []
self.unsatisfiable_on_archs = []
@ -152,6 +153,11 @@ class Excuse(object):
self.arch_build_deps[name] = []
self.arch_build_deps[name].append(arch)
def add_indep_build_dep(self, name, arch):
if name not in self.indep_build_deps:
self.indep_build_deps[name] = []
self.indep_build_deps[name].append(arch)
def add_unsatisfiable_dep(self, signature, arch):
"""Add an unsatisfiable dependency"""
self.unsat_deps[arch].add(signature)
@ -245,6 +251,16 @@ class Excuse(object):
else:
res = res + "<li>Build-Depends(-Arch): %s <a href=\"#%s\">%s</a>\n" % (self.name, dep, dep)
for x in sorted(self.indep_build_deps, key=lambda x: x.split('/')[0]):
dep = x.split('/')[0]
if dep == lastdep:
continue
lastdep = dep
if x in self.invalid_build_deps:
res = res + "<li>Build-Depends-Indep: %s <a href=\"#%s\">%s</a> (not ready)\n" % (self.name, dep, dep)
else:
res = res + "<li>Build-Depends-Indep: %s <a href=\"#%s\">%s</a>\n" % (self.name, dep, dep)
res = res + "</ul>\n"
return res
@ -292,10 +308,11 @@ class Excuse(object):
'on-architectures': sorted(self.missing_builds),
'on-unimportant-architectures': sorted(self.missing_builds_ood_arch),
}
if self.deps or self.invalid_deps or self.arch_build_deps or self.invalid_build_deps or self.break_deps or self.unsat_deps:
if self.deps or self.invalid_deps or self.arch_build_deps or self.indep_build_deps \
or self.invalid_build_deps or self.break_deps or self.unsat_deps:
excusedata['dependencies'] = dep_data = {}
migrate_after = sorted((self.deps.keys() - self.invalid_deps)
| (self.arch_build_deps.keys() - self.invalid_build_deps))
migrate_after_bd = (self.arch_build_deps.keys() | self.indep_build_deps.keys()) - self.invalid_build_deps
migrate_after = sorted((self.deps.keys() - self.invalid_deps) | migrate_after_bd)
break_deps = [x for x, _ in self.break_deps if x not in self.deps]
if self.invalid_deps or self.invalid_build_deps:

@ -834,11 +834,14 @@ def invalidate_excuses(excuses, valid, invalid):
# build the reverse dependencies
revdeps = defaultdict(list)
revbuilddeps = defaultdict(list)
revindepbuilddeps = defaultdict(list)
for exc in excuses.values():
for d in exc.deps:
revdeps[d].append(exc.name)
for d in exc.arch_build_deps:
revbuilddeps[d].append(exc.name)
for d in exc.indep_build_deps:
revindepbuilddeps[d].append(exc.name)
# loop on the invalid excuses
for ename in iter_except(invalid.pop, KeyError):
@ -883,6 +886,20 @@ def invalidate_excuses(excuses, valid, invalid):
if excuses[x].policy_verdict.value < rdep_verdict.value:
excuses[x].policy_verdict = rdep_verdict
if ename in revindepbuilddeps:
for x in revindepbuilddeps[ename]:
# if the item is valid and it is not marked as `forced', then we invalidate it
if x in valid and not excuses[x].forced:
# otherwise, invalidate the dependency and mark as invalidated and
# remove the depending excuses
excuses[x].invalidate_build_dep(ename)
valid.discard(x)
invalid.add(x)
excuses[x].addhtml("Invalidated by build-dependency (indep)")
if excuses[x].policy_verdict.value < rdep_verdict.value:
excuses[x].policy_verdict = rdep_verdict
def compile_nuninst(binaries_t, inst_tester, architectures, nobreakall_arches):
"""Compile a nuninst dict from the current testing

Loading…
Cancel
Save