Only record a package once in the source->binary package mapping

If there are multiple versions of an arch:all package in unstable (due
to outdated or no longer built arch:any packages) then only one of them
should be recorded in the list of binary packages built from the source
package. Otherwise we may try and remove the binary package from various
lists multiple times, leading to crashes.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
master
Adam D. Barratt 11 years ago
parent 64e6384270
commit 24699c1f58

@ -555,12 +555,20 @@ class Britney(object):
if "(" in source:
dpkg[SOURCEVER] = source[source.find("(")+1:source.find(")")]
pkgarch = "%s/%s" % (pkg,arch)
# if the source package is available in the distribution, then register this binary package
if dpkg[SOURCE] in sources[distribution]:
sources[distribution][dpkg[SOURCE]][BINARIES].append(pkg + "/" + arch)
# 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 pkgarch not in sources[distribution][dpkg[SOURCE]][BINARIES]:
sources[distribution][dpkg[SOURCE]][BINARIES].append(pkgarch)
# if the source package doesn't exist, create a fake one
else:
sources[distribution][dpkg[SOURCE]] = [dpkg[SOURCEVER], 'faux', [pkg + "/" + arch], None, True]
sources[distribution][dpkg[SOURCE]] = [dpkg[SOURCEVER], 'faux', [pkgarch], None, True]
# register virtual packages and real packages that provide them
if dpkg[PROVIDES]:

Loading…
Cancel
Save