diff --git a/debget b/debget index 3246277..f49ea3c 100755 --- a/debget +++ b/debget @@ -53,50 +53,15 @@ fi set -e - +error=0 for pkgspec in $*; do set +e - apt-get -q2 --print-uris download "$pkgspec" 2>/dev/null >/dev/null + apt-get download "$pkgspec" if [ $? -ne 0 ] ; then - echo "ERROR: There is no '$pkgspec' package. Sorry." echo "If you believe the package exists then consider updating your" echo "package database using 'apt-get update'." + error=1 continue fi - set -e - # This provides only one version, but it's better than the apt-get - # call which will not work in packages not available locally - apt-cache show "$pkgspec" 2>/dev/null | grep ^Ver | - while read version; do - version=`echo $version | sed -ne '$s/^.*: \(.*\).*$/\1/p'` - echo "($pkgspec -> $version)" - done - aptdata=$(apt-get -q2 --print-uris download "$pkgspec" 2>/dev/null | grep -F "/${pkgspec}_") - if [ -z "$aptdata" ] ; then - echo "ERROR: No APT data returned for '$pkgspec'. Sorry." - echo "This is probably because the package is in the local apt cache" - echo "Tip: Use 'aptitude download'" - continue - fi - url=$(echo "$aptdata" | sed -e "s/^'\([^']*\)'.*$/\1/") - file=$(echo "$aptdata" | sed -e "s/^'[^']*' \([^ ]*\).*$/\1/") - if [ -z "$url" ] ; then - echo "ERROR: Cound not obtain an URL for $pkgspec" - else - if echo "$url" | egrep -q '^tor\+'; then - if which torify 2>&1 > /dev/null; then - torify=torify - else - echo "torify not found, can not download $url" 1>&2 - exit 2 - fi - url=$(echo "$url" | sed -e 's/^tor+//') - fi - if [ -n "$torify" ]; then - echo "Downloading $pkgspec from $url via tor" - else - echo "Downloading $pkgspec from $url" - fi - $torify curl "$url" > "$file" - fi done +exit $error diff --git a/debian/changelog b/debian/changelog index fccfd64..aab36b7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,7 @@ debian-goodies (0.71) UNRELEASED; urgency=medium - * debget (and therefore also debman): - + Support apt-transport-tor i.e. tor+http:// and tor+https:// APT - repository URLs. (Closes: #821156) - + Replace "apt-get --print-uris --reinstall install" with "apt-get - --print-uris download" to avoid dependency resolution before - printing URLs. (Closes: #733465) + * Make debget a lightweight wrapper around "apt-get download". Speeds up + script by up to factor 2. (Closes: #821156, #733465, #733471) -- Axel Beckert Sat, 22 Apr 2017 01:48:14 +0200