diff --git a/britney.py b/britney.py index 6a410f9..72fc60d 100755 --- a/britney.py +++ b/britney.py @@ -1888,7 +1888,7 @@ class Britney(object): return (is_accepted, nuninst_after, arch) - def iter_packages(self, packages, selected, nuninst=None, parent_transaction=None): + def iter_packages(self, packages, selected, nuninst=None, parent_transaction=None, try_removals=True): """Iter on the list of actions and apply them one-by-one This method applies the changes from `packages` to testing, checking the uninstallability @@ -1989,6 +1989,18 @@ 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.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, + parent_transaction=parent_transaction, + 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))