Drop now unused register_reverses and RDEPENDS

Signed-off-by: Niels Thykier <niels@thykier.net>
debian
Niels Thykier 9 years ago
parent 3d5d328738
commit 7736b53c60

@ -200,7 +200,7 @@ from excuse import Excuse
from migrationitem import MigrationItem from migrationitem import MigrationItem
from hints import HintCollection from hints import HintCollection
from britney_util import (old_libraries_format, same_source, undo_changes, from britney_util import (old_libraries_format, same_source, undo_changes,
register_reverses, compute_reverse_tree, compute_reverse_tree,
read_nuninst, write_nuninst, write_heidi, read_nuninst, write_nuninst, write_heidi,
eval_uninst, newly_uninst, make_migrationitem, eval_uninst, newly_uninst, make_migrationitem,
write_excuses, write_heidi_delta, write_controlfiles, write_excuses, write_heidi_delta, write_controlfiles,
@ -208,7 +208,7 @@ from britney_util import (old_libraries_format, same_source, undo_changes,
clone_nuninst) clone_nuninst)
from consts import (VERSION, SECTION, BINARIES, MAINTAINER, FAKESRC, from consts import (VERSION, SECTION, BINARIES, MAINTAINER, FAKESRC,
SOURCE, SOURCEVER, ARCHITECTURE, DEPENDS, CONFLICTS, SOURCE, SOURCEVER, ARCHITECTURE, DEPENDS, CONFLICTS,
PROVIDES, RDEPENDS, MULTIARCH, ESSENTIAL) PROVIDES, MULTIARCH, ESSENTIAL)
__author__ = 'Fabio Tranchitella and the Debian Release Team' __author__ = 'Fabio Tranchitella and the Debian Release Team'
__version__ = '2.0' __version__ = '2.0'
@ -672,7 +672,6 @@ class Britney(object):
deps, deps,
', '.join(final_conflicts_list) or None, ', '.join(final_conflicts_list) or None,
get_field('Provides'), get_field('Provides'),
[],
ess, ess,
] ]
@ -711,9 +710,6 @@ class Britney(object):
# add the resulting dictionary to the package list # add the resulting dictionary to the package list
packages[pkg] = dpkg packages[pkg] = dpkg
# loop again on the list of packages to register reverse dependencies and conflicts
register_reverses(packages, provides, check_doubles=False)
# return a tuple with the list of real and virtual packages # return a tuple with the list of real and virtual packages
return (packages, provides) return (packages, provides)
@ -2185,14 +2181,6 @@ class Britney(object):
affected.update(inst_tester.reverse_dependencies_of(updated_pkg_id)) affected.update(inst_tester.reverse_dependencies_of(updated_pkg_id))
affected.update(inst_tester.negative_dependencies_of(updated_pkg_id)) affected.update(inst_tester.negative_dependencies_of(updated_pkg_id))
# register reverse dependencies and conflicts for the new binary packages
if item.architecture == 'source':
pkg_iter = (p.split("/")[0] for p in source[BINARIES])
else:
ext = "/" + item.architecture
pkg_iter = (p.split("/")[0] for p in source[BINARIES] if p.endswith(ext))
register_reverses(binaries_t_a, provides_t_a, iterator=pkg_iter)
# add/update the source package # add/update the source package
if item.architecture == 'source': if item.architecture == 'source':
sources['testing'][item.package] = sources[item.suite][item.package] sources['testing'][item.package] = sources[item.suite][item.package]

@ -33,7 +33,7 @@ import yaml
from migrationitem import MigrationItem, UnversionnedMigrationItem from migrationitem import MigrationItem, UnversionnedMigrationItem
from consts import (VERSION, BINARIES, PROVIDES, DEPENDS, CONFLICTS, from consts import (VERSION, BINARIES, PROVIDES, DEPENDS, CONFLICTS,
RDEPENDS, ARCHITECTURE, SECTION, ARCHITECTURE, SECTION,
SOURCE, SOURCEVER, MAINTAINER, MULTIARCH, SOURCE, SOURCEVER, MAINTAINER, MULTIARCH,
ESSENTIAL) ESSENTIAL)
@ -201,49 +201,6 @@ def old_libraries_format(libs):
return "\n".join(" " + k + ": " + " ".join(libraries[k]) for k in libraries) + "\n" return "\n".join(" " + k + ": " + " ".join(libraries[k]) for k in libraries) + "\n"
def register_reverses(packages, provides, check_doubles=True, iterator=None,
parse_depends=apt_pkg.parse_depends,
DEPENDS=DEPENDS, RDEPENDS=RDEPENDS):
"""Register reverse dependencies and conflicts for a given
sequence of packages
This method registers the reverse dependencies and conflicts for a
given sequence of packages. "packages" is a table of real
packages and "provides" is a table of virtual packages.
iterator is the sequence of packages for which the reverse
relations should be updated.
The "X=X" parameters are optimizations to avoid "load global" in
the loops.
"""
if iterator is None:
iterator = packages.keys()
else:
iterator = ifilter_only(packages, iterator)
for pkg in iterator:
# register the list of the dependencies for the depending packages
dependencies = []
pkg_data = packages[pkg]
if pkg_data[DEPENDS]:
dependencies.extend(parse_depends(pkg_data[DEPENDS], False))
# go through the list
for p in dependencies:
for a in p:
dep = a[0]
# register real packages
if dep in packages and (not check_doubles or pkg not in packages[dep][RDEPENDS]):
packages[dep][RDEPENDS].append(pkg)
# also register packages which provide the package (if any)
if dep in provides:
for i in provides[dep]:
if i not in packages: continue
if not check_doubles or pkg not in packages[i][RDEPENDS]:
packages[i][RDEPENDS].append(pkg)
def compute_reverse_tree(inst_tester, affected): def compute_reverse_tree(inst_tester, affected):
"""Calculate the full dependency tree for a set of packages """Calculate the full dependency tree for a set of packages

@ -33,5 +33,4 @@ MULTIARCH = 5
DEPENDS = 6 DEPENDS = 6
CONFLICTS = 7 CONFLICTS = 7
PROVIDES = 8 PROVIDES = 8
RDEPENDS = 9 ESSENTIAL = 9
ESSENTIAL = 10

Loading…
Cancel
Save