diff options
-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` |