From 76b2449c1ea6ebdc1cb720e383bb870568821142 Mon Sep 17 00:00:00 2001 From: "Adam D. Barratt" Date: Tue, 15 Nov 2011 20:50:09 +0000 Subject: [PATCH] Support implicit (t)pu hint items If a hint item references unstable but its version is not correct for that suite, we compare the version to the (t)pu version (if any) and if a match is found update the item as if it had been explicitly specified as applying to that suite originally. Signed-off-by: Adam D. Barratt --- britney.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/britney.py b/britney.py index b0df2e5..a85705b 100755 --- a/britney.py +++ b/britney.py @@ -2572,21 +2572,32 @@ class Britney: ok = True # loop on the requested packages and versions - for pkg in _pkgvers: + for idx in range(len(_pkgvers)): + pkg = _pkgvers[idx] # skip removal requests if pkg.is_removal: continue + + inunstable = pkg.package in self.sources['unstable'] + rightversion = inunstable and (apt_pkg.VersionCompare(self.sources['unstable'][pkg.package][VERSION], pkg.version) == 0) + if pkg.suite == 'unstable' and not rightversion: + for suite in ['pu', 'tpu']: + if pkg.package in self.sources[suite] and apt_pkg.VersionCompare(self.sources[suite][pkg.package][VERSION], pkg.version) == 0: + pkg.suite = suite + _pkgvers[idx] = pkg + break + # handle *-proposed-updates - elif pkg.suite in ['pu', 'tpu']: + if pkg.suite in ['pu', 'tpu']: if pkg.package not in self.sources[pkg.suite]: continue if apt_pkg.VersionCompare(self.sources[pkg.suite][pkg.package][VERSION], pkg.version) != 0: self.output_write(" Version mismatch, %s %s != %s\n" % (pkg.package, pkg.version, self.sources[pkg.suite][pkg.package][VERSION])) ok = False # does the package exist in unstable? - elif pkg.package not in self.sources['unstable']: + elif not inunstable: self.output_write(" Source %s has no version in unstable\n" % pkg.package) ok = False - elif apt_pkg.VersionCompare(self.sources['unstable'][pkg.package][VERSION], pkg.version) != 0: + elif not rightversion: self.output_write(" Version mismatch, %s %s != %s\n" % (pkg.package, pkg.version, self.sources['unstable'][pkg.package][VERSION])) ok = False if not ok: