read_pkgs: Parse Provides a bit earlier

Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
Niels Thykier 2016-04-06 20:20:38 +00:00
parent 946d705e2b
commit c4e7596837

View File

@ -678,34 +678,9 @@ class Britney(object):
if "(" in source_raw:
source_version = intern(source_raw[source_raw.find("(")+1:source_raw.find(")")])
dpkg = [version,
intern(get_field('Section')),
source,
source_version,
intern(get_field('Architecture')),
get_field('Multi-Arch'),
deps,
', '.join(final_conflicts_list) or None,
get_field('Provides'),
ess,
]
# if the source package is available in the distribution, then register this binary package
if source in srcdist:
# There may be multiple versions of any arch:all packages
# (in unstable) if some architectures have out-of-date
# binaries. We only want to include the package in the
# source -> binary mapping once. It doesn't matter which
# of the versions we include as only the package name and
# architecture are recorded.
if pkg_id not in srcdist[source][BINARIES]:
srcdist[source][BINARIES].append(pkg_id)
# if the source package doesn't exist, create a fake one
else:
srcdist[source] = [source_version, 'faux', [pkg_id], None, True]
if dpkg[PROVIDES]:
parts = apt_pkg.parse_depends(dpkg[PROVIDES], False)
provides_raw = get_field('Provides')
if provides_raw:
parts = apt_pkg.parse_depends(provides_raw, False)
nprov = []
for or_clause in parts:
if len(or_clause) != 1:
@ -722,9 +697,35 @@ class Britney(object):
provided_version = intern(provided_version)
part = (provided, provided_version, intern(op))
nprov.append(part)
dpkg[PROVIDES] = nprov
provides = nprov
else:
dpkg[PROVIDES] = []
provides = []
dpkg = [version,
intern(get_field('Section')),
source,
source_version,
intern(get_field('Architecture')),
get_field('Multi-Arch'),
deps,
', '.join(final_conflicts_list) or None,
provides,
ess,
]
# if the source package is available in the distribution, then register this binary package
if source in srcdist:
# There may be multiple versions of any arch:all packages
# (in unstable) if some architectures have out-of-date
# binaries. We only want to include the package in the
# source -> binary mapping once. It doesn't matter which
# of the versions we include as only the package name and
# architecture are recorded.
if pkg_id not in srcdist[source][BINARIES]:
srcdist[source][BINARIES].append(pkg_id)
# if the source package doesn't exist, create a fake one
else:
srcdist[source] = [source_version, 'faux', [pkg_id], None, True]
# add the resulting dictionary to the package list
packages[pkg] = dpkg