From b70d1d09d705557bc47e2ea5c0409e2bc1d36582 Mon Sep 17 00:00:00 2001 From: Ivo De Decker Date: Sat, 31 Aug 2019 20:58:08 +0000 Subject: [PATCH] keep track of verdict when invalidating deps --- britney2/excuse.py | 24 ++++++++++++++---------- britney2/utils.py | 6 +++--- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/britney2/excuse.py b/britney2/excuse.py index 934410f..3327b84 100644 --- a/britney2/excuse.py +++ b/britney2/excuse.py @@ -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("
  • %s: %s %s (not considered)\n" % (field, self.name, dep, dep)) + res.append("%s: %s %s (not considered)" % (field, self.name, dep, dep)) else: - res.append("
  • %s: %s %s\n" % (field, self.name, dep, dep)) + res.append("%s: %s %s" % (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: diff --git a/britney2/utils.py b/britney2/utils.py index 53f6fe0..8c96404 100644 --- a/britney2/utils.py +++ b/britney2/utils.py @@ -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):