summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2016-06-01 10:17:26 (GMT)
committerMartin Pitt <martin.pitt@ubuntu.com>2016-06-01 10:17:26 (GMT)
commit56ac53beb63379458a73c16c633229b68cfdf414 (patch)
treedb51556e8484594df43b87b19261c0557604b2dc
parentcbac10742cc44d66c82ee9776157273a5cce7a59 (diff)
Put back apt-cache showsrc --only-source option
Otherwise we'll catch binaries from unrelated sources. This got introduced in commit 7c1a251a4, so revert that, but add a fallback for Ubuntu 12.04 to re-try without --only-source.
-rw-r--r--debian/changelog3
-rwxr-xr-xrunner/adt-run4
2 files changed, 6 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index c615ec3..20f3534 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,9 @@ autopkgtest (3.20.8) UNRELEASED; urgency=medium
"-net user,hostfwd=".
* adt-buildvm-ubuntu-cloud: Provide more user friedly error if no image
exists for the chosen release/architecture. (LP: #1586322)
+ * Put back apt-cache showsrc --only-source option, as otherwise we'll catch
+ binaries from unrelated sources. Add a fallback for Ubuntu 12.04 to re-try
+ without --only-source.
-- Martin Pitt <mpitt@debian.org> Thu, 26 May 2016 21:20:16 +0200
diff --git a/runner/adt-run b/runner/adt-run
index a29eea1..9b1946f 100755
--- a/runner/adt-run
+++ b/runner/adt-run
@@ -357,7 +357,9 @@ def build_source(kind, arg, built_binaries):
# shipped in all available versions, otherwise new binaries in pockets
# would always win.
# apt-get source is terribly noisy; only show what gets downloaded
- create_command = ('''pkgs=$(apt-cache showsrc %(src)s | awk "/^Package-List:/ { inlist=1; next } (/^ / && inlist == 1) { thissrc[\$1] = 1; next } { if (!inlist) next; inlist=0; if (intersect) {for (p in pkgs) { if (!(p in thissrc)) delete pkgs[p] }} else { for (p in thissrc) { pkgs[p] = 1}; intersect=1 }; delete thissrc } END {for (p in pkgs) print p}");'''
+ # apt in Ubuntu 12.04 does not yet understand --only-source, so add a fallback
+ create_command = ('pkgs=$(apt-cache showsrc --only-source %(src)s || [ $? != 100 ] || apt-cache showsrc %(src)s); '
+ 'pkgs=$(echo "$pkgs" | awk "/^Package-List:/ { inlist=1; next } (/^ / && inlist == 1) { thissrc[\$1] = 1; next } { if (!inlist) next; inlist=0; if (intersect) {for (p in pkgs) { if (!(p in thissrc)) delete pkgs[p] }} else { for (p in thissrc) { pkgs[p] = 1}; intersect=1 }; delete thissrc } END {for (p in pkgs) print p}");'
' [ -n "$pkgs" ] || exit 1; '
' for pkg in $pkgs; do'
' pkg_candidate=$(apt-cache policy "^$pkg\$"|sed -n "/Candidate:/ { s/^.* //; /none/d; p}") || continue;'