From 55dc7ba8d136b753d3673fd0641aaff10fd6703e Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Wed, 10 Feb 2016 15:41:58 +0100 Subject: 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(-) (limited to 'bin') 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` -- cgit v1.2.3-54-g00ecf