From a8332058eee058daea5587fcb44349c1f56f7464 Mon Sep 17 00:00:00 2001 From: "Adam D. Barratt" Date: Sat, 14 May 2011 16:42:49 +0000 Subject: [PATCH] Improve handling of bugs listed against src:foo Rather than mapping "src:foo" to "foo" whilst building the bug hashes, we store the src: bugs "as is" in the hash, and then include them in the list of relevant bugs when building the list for a source package. This avoids a situation where a bug filed against "src:foo" can impede the migration of the binary package "foo", built from a different source package. Signed-off-by: Adam D. Barratt --- britney.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/britney.py b/britney.py index b950d1b..2175fb7 100755 --- a/britney.py +++ b/britney.py @@ -602,7 +602,6 @@ class Britney: self.__log("Malformed line found in line %s" % (line), type='W') continue pkg = l[0] - if pkg.startswith('src:'): pkg = pkg[4:] bugs.setdefault(pkg, []) bugs[pkg] += l[1].split(",") return bugs @@ -655,6 +654,9 @@ class Britney: elif pkg not in self.bugs['unstable']: self.bugs['unstable'][pkg] = [] + if pkg.startswith("src:"): + pkg = pkg[4:] + # retrieve the maximum version of the package in testing: maxvert = self.__maxver(pkg, 'testing') @@ -1390,13 +1392,21 @@ class Britney: # one, the check fails and we set update_candidate to False to block the update if suite == 'unstable': for pkg in pkgs.keys(): - if pkg not in self.bugs['testing']: - self.bugs['testing'][pkg] = [] - if pkg not in self.bugs['unstable']: - self.bugs['unstable'][pkg] = [] - - new_bugs = sorted(set(self.bugs['unstable'][pkg]).difference(self.bugs['testing'][pkg])) - old_bugs = sorted(set(self.bugs['testing'][pkg]).difference(self.bugs['unstable'][pkg])) + bugs_t = [] + bugs_u = [] + if testingbugs.has_key(pkg): + bugs_t.extend(testingbugs[pkg]) + if unstablebugs.has_key(pkg): + bugs_u.extend(unstablebugs[pkg]) + if 'source' in pkgs[pkg]: + spkg = "src:%s" % (pkg) + if testingbugs.has_key(spkg): + bugs_t.extend(testingbugs[spkg]) + if unstablebugs.has_key(spkg): + bugs_u.extend(unstablebugs[spkg]) + + new_bugs = sorted(set(bugs_u).difference(bugs_t)) + old_bugs = sorted(set(bugs_t).difference(bugs_u)) if len(new_bugs) > 0: excuse.addhtml("%s (%s)