Make upgrade_testing suite agnotic (except for its name)

Signed-off-by: Niels Thykier <niels@thykier.net>
ubuntu/rebased
Niels Thykier 7 years ago
parent 63c867995b
commit 861632e270

@ -2459,7 +2459,6 @@ class Britney(object):
self.logger.info("> All non-installability counters are ok") self.logger.info("> All non-installability counters are ok")
def upgrade_testing(self): def upgrade_testing(self):
"""Upgrade testing using the unstable packages """Upgrade testing using the unstable packages
@ -2529,35 +2528,36 @@ class Britney(object):
# obsolete source packages # obsolete source packages
# a package is obsolete if none of the binary packages in testing # a package is obsolete if none of the binary packages in testing
# are built by it # are built by it
self.logger.info("> Removing obsolete source packages from testing") self.logger.info("> Removing obsolete source packages from the target suite")
# local copies for performance # local copies for performance
sources = self.sources['testing'] target_suite = self.suite_info.target_suite
binaries = self.binaries['testing'] sources_t = target_suite.sources
used = set(binaries[arch][0][binary].source binaries_t = target_suite.binaries
for arch in binaries used = set(binaries_t[arch][0][binary].source
for binary in binaries[arch][0] for arch in binaries_t
for binary in binaries_t[arch][0]
) )
removals = [ MigrationItem("-%s/%s" % (source, sources[source].version)) removals = [MigrationItem("-%s/%s" % (source, sources_t[source].version))
for source in sources if source not in used for source in sources_t if source not in used
] ]
if removals: if removals:
output_logger.info("Removing obsolete source packages from testing (%d):", len(removals)) output_logger.info("Removing obsolete source packages from the target suite (%d):", len(removals))
self.do_all(actions=removals) self.do_all(actions=removals)
# smooth updates # smooth updates
removals = old_libraries(self.suite_info, self.options.outofsync_arches) removals = old_libraries(self.suite_info, self.options.outofsync_arches)
if self.options.smooth_updates: if self.options.smooth_updates:
self.logger.info("> Removing old packages left in testing from smooth updates") self.logger.info("> Removing old packages left in the target suite from smooth updates")
if removals: if removals:
output_logger.info("Removing packages left in testing for smooth updates (%d):", len(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) log_and_format_old_libraries(self.output_logger, removals)
self.do_all(actions=removals) self.do_all(actions=removals)
removals = old_libraries(self.suite_info, self.options.outofsync_arches) removals = old_libraries(self.suite_info, self.options.outofsync_arches)
else: else:
self.logger.info("> Not removing old packages left in testing from smooth updates" self.logger.info("> Not removing old packages left in the target suite from smooth updates"
" (smooth-updates disabled)") " (smooth-updates disabled)")
output_logger.info("List of old libraries in testing (%d):", len(removals)) output_logger.info("List of old libraries in the target suite (%d):", len(removals))
log_and_format_old_libraries(self.output_logger, removals) log_and_format_old_libraries(self.output_logger, removals)
self.assert_nuninst_is_correct() self.assert_nuninst_is_correct()
@ -2567,10 +2567,10 @@ class Britney(object):
target_suite = self.suite_info.target_suite target_suite = self.suite_info.target_suite
# re-write control files # re-write control files
if self.options.control_files: if self.options.control_files:
self.logger.info("Writing new testing control files to %s", self.logger.info("Writing new control files for the target suite to %s",
self.suite_info['testing'].path) target_suite.path)
write_controlfiles(self.sources, self.binaries, write_controlfiles(self.sources, self.binaries,
'testing', self.suite_info['testing'].path) target_suite.name, target_suite.path)
for policy in self.policies: for policy in self.policies:
policy.save_state(self) policy.save_state(self)

Loading…
Cancel
Save