From 3d95702a59992454312e13d0d3e5c8d4462ee748 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Thu, 27 Feb 2014 18:40:50 +0100 Subject: [PATCH 1/2] Block packages with unsatisfiable depends and don't run tests for them In excuse_unsat_deps(), mark unsatisfiable dependencies not just in the HTML, but also in the invalid_deps list. If we have any of those in should_upgrade_src(), block the package and don't run the autopkgtest. This avoid running tests for known-uninstallable packages, which just leads to guaranteed failures, manual intervention of re-running tests after it becomes installable, and spamming maintainers with a FAIL/PASS notification. --- britney.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/britney.py b/britney.py index f085c1f..f15e0d3 100755 --- a/britney.py +++ b/britney.py @@ -1087,6 +1087,7 @@ class Britney(object): # if no package can satisfy the dependency, add this information to the excuse if len(packages) == 0: + excuse.invalidate_dep(block_txt.strip()) excuse.addhtml("%s/%s unsatisfiable Depends: %s" % (pkg, arch, block_txt.strip())) continue @@ -1507,6 +1508,11 @@ class Britney(object): excuse.addhtml(text) + # if the source has uninstallable dependencies, block the update + if excuse.invalid_deps: + update_candidate = False + run_autopkgtest = False + # if the source package has no binaries, set update_candidate to False to block the update if len(self.sources[suite][src][BINARIES]) == 0: excuse.addhtml("%s has no binaries on any arch" % src) From 62bf1130f7e68325c17ec5823f47a9dc29042f78 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 5 Mar 2014 15:03:45 +0000 Subject: [PATCH 2/2] Take a different approach to excluding packages with unsatisfiable dependencies (see https://code.launchpad.net/~pitti/britney/britney2-autopkgtest-fixes/+merge/208657). --- britney.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/britney.py b/britney.py index f15e0d3..1b87638 100755 --- a/britney.py +++ b/britney.py @@ -1067,6 +1067,8 @@ class Britney(object): return deps = binary_u[DEPENDS] + all_satisfiable = True + # for every dependency block (formed as conjunction of disjunction) for block, block_txt in zip(parse_depends(deps, False), deps.split(',')): # if the block is satisfied in testing, then skip the block @@ -1087,8 +1089,8 @@ class Britney(object): # if no package can satisfy the dependency, add this information to the excuse if len(packages) == 0: - excuse.invalidate_dep(block_txt.strip()) excuse.addhtml("%s/%s unsatisfiable Depends: %s" % (pkg, arch, block_txt.strip())) + all_satisfiable = False continue # for the solving packages, update the excuse to add the dependencies @@ -1101,6 +1103,8 @@ class Britney(object): else: excuse.add_break_dep(p, arch) + return all_satisfiable + # Package analysis methods # ------------------------ @@ -1175,6 +1179,7 @@ class Britney(object): # the starting point is that there is nothing wrong and nothing worth doing anywrongver = False anyworthdoing = False + unsat_deps = False # for every binary package produced by this source in unstable for this architecture for pkg in sorted(ifilter(lambda x: x.endswith("/" + arch), source_u[BINARIES]), key=lambda x: x.split("/")[0]): @@ -1211,7 +1216,8 @@ class Britney(object): break # find unsatisfied dependencies for the new binary package - self.excuse_unsat_deps(pkg_name, src, arch, suite, excuse) + if not self.excuse_unsat_deps(pkg_name, src, arch, suite, excuse): + unsat_deps = False # if the binary is not present in testing, then it is a new binary; # in this case, there is something worth doing @@ -1271,7 +1277,7 @@ class Britney(object): anyworthdoing = True # if there is nothing wrong and there is something worth doing, this is a valid candidate - if not anywrongver and anyworthdoing: + if not anywrongver and not unsat_deps and anyworthdoing: excuse.is_valid = True self.excuses.append(excuse) return True @@ -1483,7 +1489,10 @@ class Britney(object): # if the package is architecture-dependent or the current arch is `nobreakall' # find unsatisfied dependencies for the binary package if binary_u[ARCHITECTURE] != 'all' or arch in self.options.nobreakall_arches.split(): - self.excuse_unsat_deps(pkg, src, arch, suite, excuse) + if not self.excuse_unsat_deps(pkg, src, arch, suite, excuse): + update_candidate = False + if arch in self.options.adt_arches.split(): + run_autopkgtest = False # if there are out-of-date packages, warn about them in the excuse and set update_candidate # to False to block the update; if the architecture where the package is out-of-date is @@ -1508,11 +1517,6 @@ class Britney(object): excuse.addhtml(text) - # if the source has uninstallable dependencies, block the update - if excuse.invalid_deps: - update_candidate = False - run_autopkgtest = False - # if the source package has no binaries, set update_candidate to False to block the update if len(self.sources[suite][src][BINARIES]) == 0: excuse.addhtml("%s has no binaries on any arch" % src)