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 <ivodd@debian.org>
debian
Ivo De Decker 9 years ago
parent 3326f948db
commit 984b07b58e

@ -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 = ()

@ -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

Loading…
Cancel
Save