mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-05-23 08:21:30 +00:00
Move loop invariant out of the loop
Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
parent
da5e797fc9
commit
31377a7c39
@ -969,6 +969,7 @@ class Britney(object):
|
|||||||
solving packages.
|
solving packages.
|
||||||
"""
|
"""
|
||||||
packages = []
|
packages = []
|
||||||
|
binaries_s_a, provides_s_a = packages_s_a
|
||||||
|
|
||||||
# for every package, version and operation in the block
|
# for every package, version and operation in the block
|
||||||
for name, version, op in block:
|
for name, version, op in block:
|
||||||
@ -978,8 +979,8 @@ class Britney(object):
|
|||||||
archqual = None
|
archqual = None
|
||||||
|
|
||||||
# look for the package in unstable
|
# look for the package in unstable
|
||||||
if name in packages_s_a[0]:
|
if name in binaries_s_a:
|
||||||
package = packages_s_a[0][name]
|
package = binaries_s_a[name]
|
||||||
# check the versioned dependency and architecture qualifier
|
# check the versioned dependency and architecture qualifier
|
||||||
# (if present)
|
# (if present)
|
||||||
if (op == '' and version == '') or apt_pkg.check_dep(package[VERSION], op, version):
|
if (op == '' and version == '') or apt_pkg.check_dep(package[VERSION], op, version):
|
||||||
@ -987,8 +988,8 @@ class Britney(object):
|
|||||||
packages.append(name)
|
packages.append(name)
|
||||||
|
|
||||||
# look for the package in the virtual packages list and loop on them
|
# look for the package in the virtual packages list and loop on them
|
||||||
for prov in packages_s_a[1].get(name, []):
|
for prov in provides_s_a.get(name, []):
|
||||||
if prov not in packages_s_a[0]: continue
|
if prov not in binaries_s_a: continue
|
||||||
# A provides only satisfies:
|
# A provides only satisfies:
|
||||||
# - an unversioned dependency (per Policy Manual §7.5)
|
# - an unversioned dependency (per Policy Manual §7.5)
|
||||||
# - a dependency without an architecture qualifier
|
# - a dependency without an architecture qualifier
|
||||||
|
Loading…
x
Reference in New Issue
Block a user