doop_source: Remove redundant part of the return value

Signed-off-by: Niels Thykier <niels@thykier.net>
debian
Niels Thykier 11 years ago
parent a46dd88709
commit baa9eebc5c

@ -1938,9 +1938,9 @@ class Britney(object):
This method applies the changes required by the action `item` tracking This method applies the changes required by the action `item` tracking
them so it will be possible to revert them. them so it will be possible to revert them.
The method returns a list of the package name, the suite where the The method returns a tuple containing a set of packages
package comes from, the set of packages affected by the change and affected by the change (as (name, arch)-tuples) and the
the dictionary undo which can be used to rollback the changes. dictionary undo which can be used to rollback the changes.
""" """
undo = {'binaries': {}, 'sources': {}, 'virtual': {}, 'nvirtual': []} undo = {'binaries': {}, 'sources': {}, 'virtual': {}, 'nvirtual': []}
@ -2068,7 +2068,7 @@ class Britney(object):
sources['testing'][item.package] = sources[item.suite][item.package] sources['testing'][item.package] = sources[item.suite][item.package]
# return the package name, the suite, the list of affected packages and the undo dictionary # return the package name, the suite, the list of affected packages and the undo dictionary
return (item, affected, undo) return (affected, undo)
def _check_packages(self, binaries, arch, affected, skip_archall, nuninst): def _check_packages(self, binaries, arch, affected, skip_archall, nuninst):
@ -2130,8 +2130,8 @@ class Britney(object):
removals.update(rms) removals.update(rms)
for item in hinted_packages: for item in hinted_packages:
_, affected, undo = self.doop_source(item, affected, undo = self.doop_source(item,
removals=removals) removals=removals)
all_affected.update(affected) all_affected.update(affected)
if lundo is not None: if lundo is not None:
lundo.append((undo,item)) lundo.append((undo,item))
@ -2183,7 +2183,7 @@ class Britney(object):
# loop on the packages (or better, actions) # loop on the packages (or better, actions)
while packages: while packages:
pkg = packages.pop(0) item = packages.pop(0)
# this is the marker for the first loop # this is the marker for the first loop
if not mark_passed and position < 0: if not mark_passed and position < 0:
@ -2195,21 +2195,21 @@ class Britney(object):
# defer packages if their dependency has been already skipped # defer packages if their dependency has been already skipped
if not mark_passed: if not mark_passed:
defer = False defer = False
for p in dependencies.get(pkg, []): for p in dependencies.get(item, []):
if p in skipped: if p in skipped:
deferred.append(make_migrationitem(pkg, self.sources)) deferred.append(make_migrationitem(item, self.sources))
skipped.append(make_migrationitem(pkg, self.sources)) skipped.append(make_migrationitem(item, self.sources))
defer = True defer = True
break break
if defer: continue if defer: continue
self.output_write("trying: %s\n" % (pkg.uvname)) self.output_write("trying: %s\n" % (item.uvname))
better = True better = True
nuninst = {} nuninst = {}
# apply the changes # apply the changes
item, affected, undo = self.doop_source(pkg, lundo) affected, undo = self.doop_source(item, lundo)
# check the affected packages on all the architectures # check the affected packages on all the architectures
for arch in (item.architecture == 'source' and architectures or (item.architecture,)): for arch in (item.architecture == 'source' and architectures or (item.architecture,)):
@ -2233,10 +2233,10 @@ class Britney(object):
# check if the action improved the uninstallability counters # check if the action improved the uninstallability counters
if better: if better:
lundo.append((undo, item)) lundo.append((undo, item))
selected.append(pkg) selected.append(item)
packages.extend(extra) packages.extend(extra)
extra = [] extra = []
self.output_write("accepted: %s\n" % (pkg.uvname)) self.output_write("accepted: %s\n" % (item.uvname))
self.output_write(" ori: %s\n" % (self.eval_nuninst(self.nuninst_orig))) self.output_write(" ori: %s\n" % (self.eval_nuninst(self.nuninst_orig)))
self.output_write(" pre: %s\n" % (self.eval_nuninst(nuninst_comp))) self.output_write(" pre: %s\n" % (self.eval_nuninst(nuninst_comp)))
self.output_write(" now: %s\n" % (self.eval_nuninst(nuninst, nuninst_comp))) self.output_write(" now: %s\n" % (self.eval_nuninst(nuninst, nuninst_comp)))
@ -2247,8 +2247,8 @@ class Britney(object):
for k in nuninst: for k in nuninst:
nuninst_comp[k] = nuninst[k] nuninst_comp[k] = nuninst[k]
else: else:
self.output_write("skipped: %s (%d <- %d)\n" % (pkg.uvname, len(extra), len(packages))) self.output_write("skipped: %s (%d <- %d)\n" % (item.uvname, len(extra), len(packages)))
self.output_write(" got: %s\n" % (self.eval_nuninst(nuninst, pkg.architecture != 'source' and nuninst_comp or None))) self.output_write(" got: %s\n" % (self.eval_nuninst(nuninst, item.architecture != 'source' and nuninst_comp or None)))
self.output_write(" * %s: %s\n" % (arch, ", ".join(sorted(b for b in nuninst[arch] if b not in nuninst_comp[arch])))) self.output_write(" * %s: %s\n" % (arch, ", ".join(sorted(b for b in nuninst[arch] if b not in nuninst_comp[arch]))))
extra.append(item) extra.append(item)

Loading…
Cancel
Save