From 84bad954ad05477f5abfe395937f6e298f383558 Mon Sep 17 00:00:00 2001 From: "Adam D. Barratt" Date: Mon, 1 Jul 2013 18:13:51 +0000 Subject: [PATCH] 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 --- britney.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/britney.py b/britney.py index d9663b3..11c4480 100755 --- a/britney.py +++ b/britney.py @@ -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]: