From e3af8993be8ceafce4b56ab1a394d8b2473b679b Mon Sep 17 00:00:00 2001 From: Ivo De Decker Date: Mon, 2 Sep 2019 19:28:51 +0000 Subject: [PATCH] compute_groups: rename badly named source_name When the item is a cruft removal item, the variable contains the binary name, not the source name. So rename it to item_package and set source_name, to the source in both cases. Signed-off-by: Ivo De Decker --- britney2/migration.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/britney2/migration.py b/britney2/migration.py index 436d219..cb33b77 100644 --- a/britney2/migration.py +++ b/britney2/migration.py @@ -92,7 +92,7 @@ class MigrationManager(object): any data structure. """ # local copies for better performances - source_name = item.package + item_package = item.package target_suite = self.suite_info.target_suite binaries_t = target_suite.binaries @@ -100,6 +100,7 @@ class MigrationManager(object): # remove all binary packages (if the source already exists) if item.architecture == 'source' or not item.is_removal: + source_name = item_package if source_name in target_suite.sources: rms, smoothbins = self._compute_removals(item, allow_smooth_updates, removals) else: @@ -109,9 +110,9 @@ class MigrationManager(object): # single binary removal; used for clearing up after smooth # updates but not supported as a manual hint else: - assert source_name in binaries_t[item.architecture] - pkg_id = binaries_t[item.architecture][source_name].pkg_id - source_name = binaries_t[item.architecture][source_name].source + assert item_package in binaries_t[item.architecture] + pkg_id = binaries_t[item.architecture][item_package].pkg_id + source_name = binaries_t[item.architecture][item_package].source rms = {pkg_id} smoothbins = set()