From 9ca30aac814df7170b09f984de71aa8f0b52586f Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sun, 13 Nov 2016 22:39:57 +0000 Subject: [PATCH] Rename a variable for clarity reasons Signed-off-by: Niels Thykier --- britney.py | 24 ++++++++++++------------ britney2/utils.py | 9 ++++----- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/britney.py b/britney.py index 99463f3..0a11f6f 100755 --- a/britney.py +++ b/britney.py @@ -2209,13 +2209,13 @@ class Britney(object): affected_remain.update(inst_tester.negative_dependencies_of(rm_pkg_id)) # remove the provided virtual packages - for j, prov_version, _ in pkg_data.provides: - key = (j, parch) + for provided_pkg, prov_version, _ in pkg_data.provides: + key = (provided_pkg, parch) if key not in undo['virtual']: - undo['virtual'][key] = provides_t_a[j].copy() - provides_t_a[j].remove((binary, prov_version)) - if not provides_t_a[j]: - del provides_t_a[j] + undo['virtual'][key] = provides_t_a[provided_pkg].copy() + provides_t_a[provided_pkg].remove((binary, prov_version)) + if not provides_t_a[provided_pkg]: + del provides_t_a[provided_pkg] # finally, remove the binary package del binaries_t_a[binary] inst_tester.remove_testing_binary(rm_pkg_id) @@ -2285,14 +2285,14 @@ class Britney(object): binaries_t_a[binary] = new_pkg_data inst_tester.add_testing_binary(updated_pkg_id) # register new provided packages - for j, prov_version, _ in new_pkg_data.provides: - key = (j, parch) - if j not in provides_t_a: + for provided_pkg, prov_version, _ in new_pkg_data.provides: + key = (provided_pkg, parch) + if provided_pkg not in provides_t_a: undo['nvirtual'].append(key) - provides_t_a[j] = set() + provides_t_a[provided_pkg] = set() elif key not in undo['virtual']: - undo['virtual'][key] = provides_t_a[j].copy() - provides_t_a[j].add((binary, prov_version)) + undo['virtual'][key] = provides_t_a[provided_pkg].copy() + provides_t_a[provided_pkg].add((binary, prov_version)) if not equivalent_replacement: # all the reverse dependencies are affected by the change affected_pos.add(updated_pkg_id) diff --git a/britney2/utils.py b/britney2/utils.py index 66d49a4..10bf9dc 100644 --- a/britney2/utils.py +++ b/britney2/utils.py @@ -153,12 +153,11 @@ def undo_changes(lundo, inst_tester, sources, binaries, all_binary_packages): # STEP 4 # undo all changes to virtual packages for (undo, item) in lundo: - for p in undo['nvirtual']: - j, arch = p - del binaries['testing'][arch][1][j] + for provided_pkg, arch in undo['nvirtual']: + del binaries['testing'][arch][1][provided_pkg] for p in undo['virtual']: - j, arch = p - binaries['testing'][arch][1][j] = undo['virtual'][p] + provided_pkg, arch = p + binaries['testing'][arch][1][provided_pkg] = undo['virtual'][p] def old_libraries_format(libs):