From 98d4553185fb32d19ee358cca553dd13cb3f3e7a Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sun, 6 Jan 2019 11:55:01 +0000 Subject: [PATCH] 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 --- britney.py | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/britney.py b/britney.py index b22440c..6926877 100755 --- a/britney.py +++ b/britney.py @@ -289,6 +289,7 @@ class Britney(object): self.all_selected = [] self.excuses = {} + self.upgrade_me = [] if self.options.nuninst_cache: 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 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.extend(old_libraries(mi_factory, self.suite_info, self.options.outofsync_arches)) # write excuses to the output file if not self.options.dry_run: @@ -1425,7 +1427,7 @@ class Britney(object): res.append("%s-%d" % (arch[0], n)) 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 This method applies the changes from `packages` to testing, checking the uninstallability @@ -1538,17 +1540,6 @@ class Britney(object): else: 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("endloop: %s", self.eval_nuninst(self.nuninst_orig)) output_logger.info(" now: %s", self.eval_nuninst(nuninst_last_accepted))