[Qa-jenkins-scm] [jenkins.debian.net] 01/01: bin/find_dpkg_trigger_cycles.sh: do not use 'apt-get download --print-uris' because that will fail if only one package on the command line is not known to apt which can easily happen in unstable

Holger Levsen holger at moszumanska.debian.org
Wed Feb 10 22:06:42 UTC 2016


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 55dc7ba8d136b753d3673fd0641aaff10fd6703e
Author: Johannes 'josch' Schauer <josch at mister-muffin.de>
Date:   Wed Feb 10 15:41:58 2016 +0100

    bin/find_dpkg_trigger_cycles.sh: do not use 'apt-get download --print-uris' because that will fail if only one package on the command line is not known to apt which can easily happen in unstable
---
 bin/find_dpkg_trigger_cycles.sh | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/bin/find_dpkg_trigger_cycles.sh b/bin/find_dpkg_trigger_cycles.sh
index 1e9736b..2858be9 100755
--- a/bin/find_dpkg_trigger_cycles.sh
+++ b/bin/find_dpkg_trigger_cycles.sh
@@ -164,10 +164,15 @@ function finish {
 trap finish EXIT
 
 # find all binary packages with /triggers$
+#
+# We cannot use "apt-get --print-uris download" and use the python module
+# instead because the aforementioned command will error out if only one
+# of the package names passed to it is not known by apt. This can easily
+# happen in unstable where binarycontrol.debian.net still knows about
+# a package which was already removed.
 curl --retry 3 --retry-delay 10 --globoff "http://binarycontrol.debian.net/?q=&path=${DIST}%2F[^%2F]%2B%2Ftriggers%24&format=pkglist" \
-	| xargs apt-get $APT_OPTS --print-uris download \
-	| sed -ne "s/^'\([^']\+\)'\s\+\([^_]\+\)_.*/\2 \1/p" \
-	| sort \
+	| xargs python3 -c "import apt,sys;c=apt.Cache();[print(c[n].candidate.uri) for n in sys.argv[1:] if n in c]" \
+	| sort -u \
 	| while read pkg url; do
 	echo "working on $pkg..." >&2
 	tmpdir=`mktemp -d --tmpdir="$scratch" -t dpkg-trigger-cycles-curl-XXXXXXXX`

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list