Avoid marking more valid excuses as impossible.

Previously we could not reliably detect whether an excuse's dependency
from a source package to a binNMU was valid, as the excuse did not
contain sufficient information to determine the set of  architecture(s)
on which the dependency existed.

By modifying the representation of the dependency list in the excuse to
include an architecture list we can walk the relationships in reverse
in order to sanity-check the source -> binNMU dependency.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
master
Adam D. Barratt 13 years ago
parent 72c5d612eb
commit 7ad9eb0b35

@ -1049,7 +1049,7 @@ class Britney:
# for the solving packages, update the excuse to add the dependencies
for p in packages:
if arch not in self.options.break_arches.split():
excuse.add_dep(p)
excuse.add_dep(p, arch)
else:
excuse.add_break_dep(p, arch)
@ -1601,14 +1601,29 @@ class Britney:
parts = e.name.split('/')
for d in e.deps:
ok = False
# source -> source dependency; both packages must have
# valid excuses
if d in upgrade_me or d in unconsidered:
ok = True
# if the excuse is for a binNMU, also consider d/$arch as a
# valid excuse
if len(parts) == 2:
elif len(parts) == 2:
bd = '%s/%s' % (d, parts[1])
if bd in upgrade_me or bd in unconsidered:
ok = True
# if the excuse is for a source package, check each of the
# architectures on which the excuse lists a dependency on d,
# and consider the excuse valid if it is possible on each
# architecture
else:
arch_ok = True
for arch in e.deps[d]:
bd = '%s/%s' % (d, arch)
if bd not in upgrade_me and bd not in unconsidered:
arch_ok = False
break
if arch_ok:
ok = True
if not ok:
e.addhtml("Impossible dependency: %s -> %s" % (e.name, d))
self.invalidate_excuses(upgrade_me, unconsidered)

@ -53,7 +53,7 @@ class Excuse:
self.dontinvalidate = 0
self.invalid_deps = []
self.deps = []
self.deps = {}
self.sane_deps = []
self.break_deps = []
self.unsat_deps = {}
@ -85,9 +85,10 @@ class Excuse:
"""Set the urgency of upload of the package"""
self.urgency = date
def add_dep(self, name):
def add_dep(self, name, arch):
"""Add a dependency"""
if name not in self.deps: self.deps.append(name)
if name not in self.deps: self.deps[name]=[]
self.deps[name].append(arch)
def add_sane_dep(self, name):
"""Add a sane dependency"""

Loading…
Cancel
Save