mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-08-08 06:04:06 +00:00
Refactor doop_source to simplify logic
Cleanly split doop_source into a (small) part about source packages and a (longer) part about binary packages. Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
parent
027142e12b
commit
0f45b195a6
41
britney.py
41
britney.py
@ -2170,14 +2170,23 @@ class Britney(object):
|
|||||||
item.is_removal,
|
item.is_removal,
|
||||||
removals=removals)
|
removals=removals)
|
||||||
|
|
||||||
# remove all binary packages (if the source already exists)
|
# Handle the source package
|
||||||
if item.architecture == 'source' or not item.is_removal:
|
if item.architecture == 'source':
|
||||||
if item.package in sources['testing']:
|
if item.package in sources['testing']:
|
||||||
source = sources['testing'][item.package]
|
source = sources['testing'][item.package]
|
||||||
|
undo['sources'][item.package] = source
|
||||||
|
del sources['testing'][item.package]
|
||||||
|
else:
|
||||||
|
# the package didn't exist, so we mark it as to-be-removed in case of undo
|
||||||
|
undo['sources']['-' + item.package] = True
|
||||||
|
|
||||||
|
# add/update the source package
|
||||||
|
if not item.is_removal:
|
||||||
|
sources['testing'][item.package] = sources[item.suite][item.package]
|
||||||
|
|
||||||
|
# If we are removing *and* updating packages, then check for eqv. packages
|
||||||
|
if rms and updates:
|
||||||
eqv_table = {}
|
eqv_table = {}
|
||||||
|
|
||||||
for rm_pkg_id in rms:
|
for rm_pkg_id in rms:
|
||||||
binary, _, parch = rm_pkg_id
|
binary, _, parch = rm_pkg_id
|
||||||
key = (binary, parch)
|
key = (binary, parch)
|
||||||
@ -2218,27 +2227,9 @@ class Britney(object):
|
|||||||
# finally, remove the binary package
|
# finally, remove the binary package
|
||||||
del binaries_t_a[binary]
|
del binaries_t_a[binary]
|
||||||
inst_tester.remove_testing_binary(rm_pkg_id)
|
inst_tester.remove_testing_binary(rm_pkg_id)
|
||||||
# remove the source package
|
|
||||||
if item.architecture == 'source':
|
|
||||||
undo['sources'][item.package] = source
|
|
||||||
del sources['testing'][item.package]
|
|
||||||
else:
|
|
||||||
# the package didn't exist, so we mark it as to-be-removed in case of undo
|
|
||||||
undo['sources']['-' + item.package] = True
|
|
||||||
|
|
||||||
# single binary removal; used for clearing up after smooth
|
# Add/Update binary packages in testing
|
||||||
# updates but not supported as a manual hint
|
if updates:
|
||||||
else:
|
|
||||||
assert item.package in packages_t[item.architecture][0]
|
|
||||||
binaries_t_a = packages_t[item.architecture][0]
|
|
||||||
pkg_id = binaries_t_a[item.package].pkg_id
|
|
||||||
undo['binaries'][(item.package, item.architecture)] = pkg_id
|
|
||||||
affected_pos.update(inst_tester.reverse_dependencies_of(pkg_id))
|
|
||||||
del binaries_t_a[item.package]
|
|
||||||
inst_tester.remove_testing_binary(pkg_id)
|
|
||||||
|
|
||||||
# add the new binary packages (if we are not removing)
|
|
||||||
if not item.is_removal:
|
|
||||||
packages_s = self.binaries[item.suite]
|
packages_s = self.binaries[item.suite]
|
||||||
|
|
||||||
for updated_pkg_id in updates:
|
for updated_pkg_id in updates:
|
||||||
@ -2298,10 +2289,6 @@ class Britney(object):
|
|||||||
affected_pos.add(updated_pkg_id)
|
affected_pos.add(updated_pkg_id)
|
||||||
affected_remain.update(inst_tester.negative_dependencies_of(updated_pkg_id))
|
affected_remain.update(inst_tester.negative_dependencies_of(updated_pkg_id))
|
||||||
|
|
||||||
# add/update the source package
|
|
||||||
if item.architecture == 'source':
|
|
||||||
sources['testing'][item.package] = sources[item.suite][item.package]
|
|
||||||
|
|
||||||
# Also include the transitive rdeps of the packages found so far
|
# Also include the transitive rdeps of the packages found so far
|
||||||
compute_reverse_tree(inst_tester, affected_pos)
|
compute_reverse_tree(inst_tester, affected_pos)
|
||||||
compute_reverse_tree(inst_tester, affected_remain)
|
compute_reverse_tree(inst_tester, affected_remain)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user