From 984b07b58e6f2a2553869c157f4f06de80799c90 Mon Sep 17 00:00:00 2001 From: Ivo De Decker Date: Sun, 6 Sep 2015 16:55:48 +0000 Subject: [PATCH] Don't remove outdated binaries for fucked arches if they are in unstable For fucked architectures, binaries from older versions are allowed to be in testing, so we only remove them if they are gone from unstable. Signed-off-by: Ivo De Decker --- britney.py | 4 ++-- britney_util.py | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/britney.py b/britney.py index fe65cc3..f6423a8 100755 --- a/britney.py +++ b/britney.py @@ -2604,12 +2604,12 @@ class Britney(object): # smooth updates if self.options.smooth_updates: self.__log("> Removing old packages left in testing from smooth updates", type="I") - removals = old_libraries(self.sources, self.binaries) + removals = old_libraries(self.sources, self.binaries, self.options.fucked_arches) if removals: self.output_write("Removing packages left in testing for smooth updates (%d):\n%s" % \ (len(removals), old_libraries_format(removals))) self.do_all(actions=removals) - removals = old_libraries(self.sources, self.binaries) + removals = old_libraries(self.sources, self.binaries, self.options.fucked_arches) else: removals = () diff --git a/britney_util.py b/britney_util.py index 99d9760..6915126 100644 --- a/britney_util.py +++ b/britney_util.py @@ -552,7 +552,7 @@ def write_controlfiles(sources, packages, suite, basedir): write_sources(sources_s, os.path.join(basedir, 'Sources')) -def old_libraries(sources, packages, same_source=same_source): +def old_libraries(sources, packages, fucked_arches=frozenset(), same_source=same_source): """Detect old libraries left in testing for smooth transitions This method detects old libraries which are in testing but no @@ -560,6 +560,10 @@ def old_libraries(sources, packages, same_source=same_source): other packages still depend on them, but they should be removed as soon as possible. + For "fucked" architectures, outdated binaries are allowed to be in + testing, so they are only added to the removal list if they are no longer + in unstable. + same_source is an optimisation to avoid "load global". """ sources_t = sources['testing'] @@ -569,7 +573,8 @@ def old_libraries(sources, packages, same_source=same_source): for arch in testing: for pkg_name in testing[arch][0]: pkg = testing[arch][0][pkg_name] - if not same_source(sources_t[pkg[SOURCE]][VERSION], pkg[SOURCEVER]): + if not same_source(sources_t[pkg[SOURCE]][VERSION], pkg[SOURCEVER]) and \ + (arch not in fucked_arches or pkg_name not in unstable[arch][0]): migration = "-" + "/".join((pkg_name, arch, pkg[SOURCEVER])) removals.append(MigrationItem(migration)) return removals