keep track of verdict when invalidating deps

ubuntu/rebased
Ivo De Decker 5 years ago
parent abaa4c7205
commit b70d1d09d7

@ -75,7 +75,7 @@ class Excuse(object):
self.forced = False
self._policy_verdict = PolicyVerdict.REJECTED_PERMANENTLY
self.all_invalid_deps = set()
self.all_invalid_deps = {}
self.all_deps = {}
self.sane_deps = []
self.break_deps = []
@ -171,9 +171,9 @@ class Excuse(object):
"""Add an unsatisfiable dependency"""
self.unsat_deps[arch].add(signature)
def invalidate_dependency(self, name):
def invalidate_dependency(self, name, verdict):
"""Invalidate dependency"""
self.all_invalid_deps.add(name)
self.all_invalid_deps[name] = verdict
def setdaysold(self, daysold, mindays):
"""Set the number of days from the upload and the minimum number of days for the update"""
@ -239,11 +239,11 @@ class Excuse(object):
continue
seen[deptype] = True
if x in invalid_deps:
res.append("<li>%s: %s <a href=\"#%s\">%s</a> (not considered)\n" % (field, self.name, dep, dep))
res.append("%s: %s <a href=\"#%s\">%s</a> (not considered)" % (field, self.name, dep, dep))
else:
res.append("<li>%s: %s <a href=\"#%s\">%s</a>\n" % (field, self.name, dep, dep))
res.append("%s: %s <a href=\"#%s\">%s</a>" % (field, self.name, dep, dep))
return "".join(res)
return res
def html(self):
"""Render the excuse in HTML"""
@ -274,6 +274,10 @@ class Excuse(object):
for v in sorted(self.verdict_info.keys(), reverse=True):
for x in self.verdict_info[v]:
res.append("" + x + "")
di = [x for x in self.all_invalid_deps.keys() if self.all_invalid_deps[x] == v]
ad = {x: self.all_deps[x] for x in di}
for x in self._render_dep_issues(ad, di):
res.append("" + x + "")
if self.infoline:
res.append("Additional info:")
for x in self.infoline:
@ -313,14 +317,14 @@ class Excuse(object):
}
if self.all_invalid_deps:
excusedata['invalidated-by-other-package'] = True
if self.all_deps or self.all_invalid_deps \
if self.all_deps or self.all_invalid_deps.keys() \
or self.break_deps or self.unsat_deps:
excusedata['dependencies'] = dep_data = {}
migrate_after = sorted(self.all_deps.keys() - self.all_invalid_deps)
migrate_after = sorted(self.all_deps.keys() - self.all_invalid_deps.keys())
break_deps = [x for x, _ in self.break_deps if x not in self.all_deps]
if self.all_invalid_deps:
dep_data['blocked-by'] = sorted(self.all_invalid_deps)
if self.all_invalid_deps.keys():
dep_data['blocked-by'] = sorted(self.all_invalid_deps.keys())
if migrate_after:
dep_data['migrate-after'] = migrate_after
if break_deps:

@ -700,16 +700,16 @@ def invalidate_excuses(excuses, valid, invalid):
# 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:
if excuses[x].policy_verdict < rdep_verdict:
excuses[x].policy_verdict = rdep_verdict
# otherwise, invalidate the dependency and mark as invalidated and
# remove the depending excuses
excuses[x].invalidate_dependency(ename)
excuses[x].invalidate_dependency(ename, rdep_verdict)
valid.discard(x)
invalid.add(x)
for deptype in allrevdeps[ename][x]:
excuses[x].addhtml("Invalidated by %s" % deptype.get_description())
excuses[x].addreason(deptype.get_reason())
if excuses[x].policy_verdict < rdep_verdict:
excuses[x].policy_verdict = rdep_verdict
def compile_nuninst(target_suite, architectures, nobreakall_arches):

Loading…
Cancel
Save