Make checking for smooth updates candidates smarter

Commit 94071b1649 excluded intra-source
dependencies from the determination as to whether a binary package was
eligible for smooth updates.  Whilst this works in many cases, there
are situations where it breaks migration.  For instance:

  foo depends on libdropped1
  libdropped1 depends on libdropped2
  libdropped1 and libdropped2 are built from the same source; foo from
     another source
  libdropped2 is otherwise leaf in testing

In order to resolve this, we build a list of all packages which might
be eligible and filter out those which have reverse-dependencies outside
of their source package.  For each remaining package, we consider it
eligible if its intra-source reverse-dependencies are within the list
of packages already determined to be eligible.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
debian
Adam D. Barratt 13 years ago
parent 036d8be9d0
commit 85387e9a37

@ -1814,20 +1814,54 @@ class Britney:
if not (arch and pkg[0] == '-'): if not (arch and pkg[0] == '-'):
if pkg_name in sources['testing']: if pkg_name in sources['testing']:
source = sources['testing'][pkg_name] source = sources['testing'][pkg_name]
bins = []
check = []
smoothbins = []
# remove all the binaries # remove all the binaries
# first, build a list of eligible binaries
for p in source[BINARIES]: for p in source[BINARIES]:
binary, parch = p.split("/") binary, parch = p.split("/")
if arch and parch != arch: continue if arch and parch != arch: continue
# do not remove binaries which have been hijacked by other sources # do not remove binaries which have been hijacked by other sources
if binaries[parch][0][binary][SOURCE] != pkg_name: continue if binaries[parch][0][binary][SOURCE] != pkg_name: continue
rdeps = binaries[parch][0][binary][RDEPENDS] bins.append(p)
for p in bins:
binary, parch = p.split("/")
# if a smooth update is possible for the package, skip it # if a smooth update is possible for the package, skip it
if not self.options.compatible and suite == 'unstable' and \ if not self.options.compatible and suite == 'unstable' and \
binary not in self.binaries[suite][parch][0] and \ binary not in self.binaries[suite][parch][0] and \
len([x for x in rdeps if x not in [y.split("/")[0] for y in source[BINARIES]]]) > 0 and \
('ALL' in self.options.smooth_updates or \ ('ALL' in self.options.smooth_updates or \
binaries[parch][0][binary][SECTION] in self.options.smooth_updates): binaries[parch][0][binary][SECTION] in self.options.smooth_updates):
continue
# if the package has reverse-dependencies which are
# built from other sources, it's a valid candidate for
# a smooth update. if not, it may still be a valid
# candidate if one if its r-deps is itself a candidate,
# so note it for checking later
rdeps = binaries[parch][0][binary][RDEPENDS]
if len([x for x in rdeps if x not in [y.split("/")[0] for y in bins]]) > 0:
smoothbins.append(p)
else:
check.append(p)
# check whether we should perform a smooth update for
# packages which are candidates but do not have r-deps
# outside of the current source
for p in check:
binary, parch = p.split("/")
rdeps = [ bin for bin in binaries[parch][0][binary][RDEPENDS] \
if bin in [y.split("/")[0] for y in smoothbins] ]
if len(rdeps) > 0:
smoothbins.append(p)
# remove all the binaries which aren't being smooth updated
for p in [ bin for bin in bins if bin not in smoothbins ]:
binary, parch = p.split("/")
# save the old binary for undo # save the old binary for undo
undo['binaries'][p] = binaries[parch][0][binary] undo['binaries'][p] = binaries[parch][0][binary]
# all the reverse dependencies are affected by the change # all the reverse dependencies are affected by the change

Loading…
Cancel
Save