From bff12b18833eb2520a8dac29ad5be870eebcb59b Mon Sep 17 00:00:00 2001 From: "Adam D. Barratt" Date: Wed, 11 Apr 2012 21:10:28 +0000 Subject: [PATCH] Make smooth updates slightly more intelligent When processing a hint of the form "easy pkgX libX" where libX would be a candidate for smooth updates because pkgX/testing depends on it but pkgX/unstable does not, and there are no other reverse dependencies, the old binary from libX can simply be dropped straight away. Signed-off-by: Adam D. Barratt --- britney.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/britney.py b/britney.py index becb3e9..9cbafee 100755 --- a/britney.py +++ b/britney.py @@ -1847,8 +1847,25 @@ class Britney(object): # so note it for checking later rdeps = binaries[parch][0][binary][RDEPENDS] - if len([x for x in rdeps if x not in [y.split("/")[0] for y in bins]]) > 0: - smoothbins.append(p) + # the list of reverse-dependencies may be outdated + # if, for example, we're processing a hint and + # a new version of one of the apparent reverse-dependencies + # migrated earlier in the hint. walk the list to make + # sure that at least one of the entries is still + # valid + rdeps = [x for x in rdeps if x not in [y.split("/")[0] for y in bins]] + if len(rrdeps) > 0: + for dep in rrdeps: + if dep in binaries[parch][0]: + bin = binaries[parch][0][dep] + deps = [] + if bin[DEPENDS] is not None: + deps.extend(apt_pkg.parse_depends(bin[DEPENDS], False)) + if bin[PREDEPENDS] is not None: + deps.extend(apt_pkg.parse_depends(bin[PREDEPENDS], False)) + if any(binary == entry[0] for deplist in deps for entry in deplist): + smoothbins.append(p) + break else: check.append(p)