Use sets in the provides-table

Signed-off-by: Niels Thykier <niels@thykier.net>
debian
Niels Thykier 9 years ago
parent 19e54380c3
commit 176fe04c98

@ -608,7 +608,7 @@ class Britney(object):
""" """
packages = {} packages = {}
provides = {} provides = defaultdict(set)
sources = self.sources sources = self.sources
all_binaries = self.all_binaries all_binaries = self.all_binaries
@ -693,9 +693,7 @@ class Britney(object):
if dpkg[PROVIDES]: if dpkg[PROVIDES]:
parts = [p.strip() for p in dpkg[PROVIDES].split(",")] parts = [p.strip() for p in dpkg[PROVIDES].split(",")]
for p in parts: for p in parts:
if p not in provides: provides[p].add(pkg)
provides[p] = []
provides[p].append(pkg)
dpkg[PROVIDES] = parts dpkg[PROVIDES] = parts
else: dpkg[PROVIDES] = [] else: dpkg[PROVIDES] = []
@ -2091,7 +2089,7 @@ class Britney(object):
for j in pkg_data[PROVIDES]: for j 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][:] undo['virtual'][key] = provides_t_a[j].copy()
provides_t_a[j].remove(binary) provides_t_a[j].remove(binary)
if not provides_t_a[j]: if not provides_t_a[j]:
del provides_t_a[j] del provides_t_a[j]
@ -2174,10 +2172,10 @@ class Britney(object):
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] = [] provides_t_a[j] = set()
elif key not in undo['virtual']: elif key not in undo['virtual']:
undo['virtual'][key] = provides_t_a[j][:] undo['virtual'][key] = provides_t_a[j].copy()
provides_t_a[j].append(binary) provides_t_a[j].add(binary)
if not equivalent_replacement: if not equivalent_replacement:
# all the reverse dependencies are affected by the change # all the reverse dependencies are affected by the change
affected.add(updated_pkg_id) affected.add(updated_pkg_id)

Loading…
Cancel
Save