From 25cc2c3b36822accfedca56dcb6ddf22a85154b7 Mon Sep 17 00:00:00 2001 From: "Adam D. Barratt" Date: Wed, 6 Feb 2013 19:05:16 +0000 Subject: [PATCH] Split the tpu o-o-d checks up to make them more readable Signed-off-by: Adam D. Barratt --- britney.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/britney.py b/britney.py index 8489182..ca9209b 100755 --- a/britney.py +++ b/britney.py @@ -1366,15 +1366,20 @@ class Britney(object): if suite in ['pu', 'tpu']: # o-o-d(ish) checks for (t-)p-u for arch in self.options.architectures: - # If the package isn't in testing or the testing - # package produces no packages on this architecture, - # then it can't be out-of-date. We assume that if - # the (t-)p-u package has produced any binaries for - # this architecture then it is ok - - if not src in self.sources["testing"] or \ - (len([x for x in self.sources["testing"][src][BINARIES] if x.endswith("/"+arch) and self.binaries["testing"][arch][0][x.split("/")[0]][ARCHITECTURE] != 'all' ]) == 0) or \ - (len([x for x in self.binaries[suite][arch][0].values() \ + if src not in self.sources["testing"]: + continue + + # if the package in testing has no binaries on this + # architecture, it can't be out-of-date + if (len([x for x in self.sources["testing"][src][BINARIES] + if x.endswith("/"+arch) and self.binaries["testing"][arch][0][x.split("/")[0]][ARCHITECTURE] != 'all' ]) == 0): + continue + + # if the (t-)p-u package has produced any binaries on + # this architecture then we assume it's ok. this allows for + # uploads to (t-)p-u which intentionally drop binary + # packages + if (len([x for x in self.binaries[suite][arch][0].values() \ if x[SOURCE] == src and x[SOURCEVER] == source_u[VERSION] and \ x[ARCHITECTURE] != 'all' ]) > 0): continue