summaryrefslogtreecommitdiffstats
path: root/bin/find_dpkg_trigger_cycles.sh
diff options
context:
space:
mode:
authorJohannes 'josch' Schauer <josch@mister-muffin.de>2016-02-10 15:41:58 +0100
committerHolger Levsen <holger@layer-acht.org>2016-02-10 22:52:36 +0100
commit55dc7ba8d136b753d3673fd0641aaff10fd6703e (patch)
treec799fd99fe09ba5bd2dfb6261c232d2d2120a57c /bin/find_dpkg_trigger_cycles.sh
parent203b8722aa0c58396339e866bc8b1ff99297dedb (diff)
downloadjenkins.debian.net-55dc7ba8d136b753d3673fd0641aaff10fd6703e.tar.xz
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
Diffstat (limited to 'bin/find_dpkg_trigger_cycles.sh')
-rwxr-xr-xbin/find_dpkg_trigger_cycles.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/find_dpkg_trigger_cycles.sh b/bin/find_dpkg_trigger_cycles.sh
index 1e9736be..2858be9e 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`