Include old cruft items directly in upgrade_me

This enables us to remove the recursion in iter_packages (and thereby
the added noise from it).  As a side-effect of this change, the solver
can now solve the "left-binary-removal" test case as it can see the
relevant cruft item together with the regular items needed to solve
the migration.

Signed-off-by: Niels Thykier <niels@thykier.net>
ubuntu/rebased
Niels Thykier 6 years ago
parent 5d408fa800
commit 98d4553185
No known key found for this signature in database
GPG Key ID: A65B78DBE67C7AAC

@ -289,6 +289,7 @@ class Britney(object):
self.all_selected = [] self.all_selected = []
self.excuses = {} self.excuses = {}
self.upgrade_me = []
if self.options.nuninst_cache: if self.options.nuninst_cache:
self.logger.info("Not building the list of non-installable packages, as requested") self.logger.info("Not building the list of non-installable packages, as requested")
@ -1378,6 +1379,7 @@ class Britney(object):
# sort the list of candidates # sort the list of candidates
mi_factory = self._migration_item_factory mi_factory = self._migration_item_factory
self.upgrade_me = sorted(mi_factory.parse_item(x, versioned=False, auto_correct=False) for x in upgrade_me) self.upgrade_me = sorted(mi_factory.parse_item(x, versioned=False, auto_correct=False) for x in upgrade_me)
self.upgrade_me.extend(old_libraries(mi_factory, self.suite_info, self.options.outofsync_arches))
# write excuses to the output file # write excuses to the output file
if not self.options.dry_run: if not self.options.dry_run:
@ -1425,7 +1427,7 @@ class Britney(object):
res.append("%s-%d" % (arch[0], n)) res.append("%s-%d" % (arch[0], n))
return "%d+%d: %s" % (total, totalbreak, ":".join(res)) return "%d+%d: %s" % (total, totalbreak, ":".join(res))
def iter_packages(self, packages, selected, nuninst=None, try_removals=True): def iter_packages(self, packages, selected, nuninst=None):
"""Iter on the list of actions and apply them one-by-one """Iter on the list of actions and apply them one-by-one
This method applies the changes from `packages` to testing, checking the uninstallability This method applies the changes from `packages` to testing, checking the uninstallability
@ -1538,17 +1540,6 @@ class Britney(object):
else: else:
maybe_rescheduled_packages.append(comp[0]) maybe_rescheduled_packages.append(comp[0])
if try_removals and self.options.smooth_updates:
self.logger.info("> Removing old packages left in the target suite from smooth updates")
removals = old_libraries(self._migration_item_factory, self.suite_info, self.options.outofsync_arches)
if removals:
output_logger.info("Removing packages left in the target suite for smooth updates (%d):", len(removals))
log_and_format_old_libraries(self.output_logger, removals)
(nuninst_last_accepted, extra) = self.iter_packages(removals,
selected,
nuninst=nuninst_last_accepted,
try_removals=False)
output_logger.info(" finish: [%s]", ",".join(x.uvname for x in selected)) output_logger.info(" finish: [%s]", ",".join(x.uvname for x in selected))
output_logger.info("endloop: %s", self.eval_nuninst(self.nuninst_orig)) output_logger.info("endloop: %s", self.eval_nuninst(self.nuninst_orig))
output_logger.info(" now: %s", self.eval_nuninst(nuninst_last_accepted)) output_logger.info(" now: %s", self.eval_nuninst(nuninst_last_accepted))

Loading…
Cancel
Save