diff options
author | Johannes 'josch' Schauer <josch@mister-muffin.de> | 2016-02-10 15:41:58 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2016-02-10 22:52:36 +0100 |
commit | 55dc7ba8d136b753d3673fd0641aaff10fd6703e (patch) | |
tree | c799fd99fe09ba5bd2dfb6261c232d2d2120a57c | |
parent | 203b8722aa0c58396339e866bc8b1ff99297dedb (diff) | |
download | jenkins.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
-rwxr-xr-x | bin/find_dpkg_trigger_cycles.sh | 11 |
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` |