mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-06-06 15:21:38 +00:00
Replace some string concat+split with tuples
Replace some of the: p = binary + "/" + parch binary, parch = p.split("/") with regular tuples. Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
parent
1ddf63e14b
commit
38a198e8b2
15
britney.py
15
britney.py
@ -2123,7 +2123,7 @@ class Britney(object):
|
|||||||
# remove all the binaries which aren't being smooth updated
|
# remove all the binaries which aren't being smooth updated
|
||||||
for rm_pkg_id in rms:
|
for rm_pkg_id in rms:
|
||||||
binary, version, parch = rm_pkg_id
|
binary, version, parch = rm_pkg_id
|
||||||
p = binary + "/" + parch
|
p = (binary, parch)
|
||||||
binaries_t_a, provides_t_a = packages_t[parch]
|
binaries_t_a, provides_t_a = packages_t[parch]
|
||||||
pkey = (binary, parch)
|
pkey = (binary, parch)
|
||||||
|
|
||||||
@ -2139,7 +2139,7 @@ class Britney(object):
|
|||||||
|
|
||||||
# remove the provided virtual packages
|
# remove the provided virtual packages
|
||||||
for j, prov_version, _ in pkg_data[PROVIDES]:
|
for j, prov_version, _ in pkg_data[PROVIDES]:
|
||||||
key = j + "/" + parch
|
key = (j, parch)
|
||||||
if key not in undo['virtual']:
|
if key not in undo['virtual']:
|
||||||
undo['virtual'][key] = provides_t_a[j].copy()
|
undo['virtual'][key] = provides_t_a[j].copy()
|
||||||
provides_t_a[j].remove((binary, prov_version))
|
provides_t_a[j].remove((binary, prov_version))
|
||||||
@ -2162,7 +2162,7 @@ class Britney(object):
|
|||||||
binaries_t_a = packages_t[item.architecture][0]
|
binaries_t_a = packages_t[item.architecture][0]
|
||||||
version = binaries_t_a[item.package][VERSION]
|
version = binaries_t_a[item.package][VERSION]
|
||||||
pkg_id = (item.package, version, item.architecture)
|
pkg_id = (item.package, version, item.architecture)
|
||||||
undo['binaries'][item.package + "/" + item.architecture] = pkg_id
|
undo['binaries'][(item.package, item.architecture)] = pkg_id
|
||||||
affected.add(pkg_id)
|
affected.add(pkg_id)
|
||||||
affected.update(inst_tester.reverse_dependencies_of(pkg_id))
|
affected.update(inst_tester.reverse_dependencies_of(pkg_id))
|
||||||
del binaries_t_a[item.package]
|
del binaries_t_a[item.package]
|
||||||
@ -2174,7 +2174,6 @@ class Britney(object):
|
|||||||
|
|
||||||
for updated_pkg_id in updates:
|
for updated_pkg_id in updates:
|
||||||
binary, new_version, parch = updated_pkg_id
|
binary, new_version, parch = updated_pkg_id
|
||||||
p = "%s/%s" % (binary, parch)
|
|
||||||
key = (binary, parch)
|
key = (binary, parch)
|
||||||
binaries_t_a, provides_t_a = packages_t[parch]
|
binaries_t_a, provides_t_a = packages_t[parch]
|
||||||
equivalent_replacement = key in eqv_set
|
equivalent_replacement = key in eqv_set
|
||||||
@ -2191,7 +2190,7 @@ class Britney(object):
|
|||||||
old_version = old_pkg_data[VERSION]
|
old_version = old_pkg_data[VERSION]
|
||||||
old_pkg_id = (binary, old_version, parch)
|
old_pkg_id = (binary, old_version, parch)
|
||||||
# save the old binary package
|
# save the old binary package
|
||||||
undo['binaries'][p] = old_pkg_id
|
undo['binaries'][key] = old_pkg_id
|
||||||
if not equivalent_replacement:
|
if not equivalent_replacement:
|
||||||
# all the reverse dependencies are affected by
|
# all the reverse dependencies are affected by
|
||||||
# the change
|
# the change
|
||||||
@ -2211,8 +2210,8 @@ class Britney(object):
|
|||||||
# ignored as their reverse trees are already handled
|
# ignored as their reverse trees are already handled
|
||||||
# by this function
|
# by this function
|
||||||
for (tundo, tpkg) in hint_undo:
|
for (tundo, tpkg) in hint_undo:
|
||||||
if p in tundo['binaries']:
|
if key in tundo['binaries']:
|
||||||
tpkg_id = tundo['binaries'][p]
|
tpkg_id = tundo['binaries'][key]
|
||||||
affected.update(inst_tester.reverse_dependencies_of(tpkg_id))
|
affected.update(inst_tester.reverse_dependencies_of(tpkg_id))
|
||||||
|
|
||||||
# add/update the binary package from the source suite
|
# add/update the binary package from the source suite
|
||||||
@ -2221,7 +2220,7 @@ class Britney(object):
|
|||||||
inst_tester.add_testing_binary(updated_pkg_id)
|
inst_tester.add_testing_binary(updated_pkg_id)
|
||||||
# register new provided packages
|
# register new provided packages
|
||||||
for j, prov_version, _ in new_pkg_data[PROVIDES]:
|
for j, prov_version, _ in new_pkg_data[PROVIDES]:
|
||||||
key = j + "/" + parch
|
key = (j, parch)
|
||||||
if j not in provides_t_a:
|
if j not in provides_t_a:
|
||||||
undo['nvirtual'].append(key)
|
undo['nvirtual'].append(key)
|
||||||
provides_t_a[j] = set()
|
provides_t_a[j] = set()
|
||||||
|
@ -134,7 +134,7 @@ def undo_changes(lundo, inst_tester, sources, binaries, all_binary_packages,
|
|||||||
# undo all other binary package changes (except virtual packages)
|
# undo all other binary package changes (except virtual packages)
|
||||||
for (undo, item) in lundo:
|
for (undo, item) in lundo:
|
||||||
for p in undo['binaries']:
|
for p in undo['binaries']:
|
||||||
binary, arch = p.split("/")
|
binary, arch = p
|
||||||
if binary[0] == "-":
|
if binary[0] == "-":
|
||||||
version = binaries["testing"][arch][0][binary][VERSION]
|
version = binaries["testing"][arch][0][binary][VERSION]
|
||||||
del binaries['testing'][arch][0][binary[1:]]
|
del binaries['testing'][arch][0][binary[1:]]
|
||||||
@ -152,10 +152,10 @@ def undo_changes(lundo, inst_tester, sources, binaries, all_binary_packages,
|
|||||||
# undo all changes to virtual packages
|
# undo all changes to virtual packages
|
||||||
for (undo, item) in lundo:
|
for (undo, item) in lundo:
|
||||||
for p in undo['nvirtual']:
|
for p in undo['nvirtual']:
|
||||||
j, arch = p.split("/")
|
j, arch = p
|
||||||
del binaries['testing'][arch][1][j]
|
del binaries['testing'][arch][1][j]
|
||||||
for p in undo['virtual']:
|
for p in undo['virtual']:
|
||||||
j, arch = p.split("/")
|
j, arch = p
|
||||||
if j[0] == '-':
|
if j[0] == '-':
|
||||||
del binaries['testing'][arch][1][j[1:]]
|
del binaries['testing'][arch][1][j[1:]]
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user