From: Colin Watson Date: Sat, 11 Jan 2003 17:33:48 +0000 (+0000) Subject: debman: With a version of debget that supports file: via curl, using it is X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=ab0ba11ceb05101861dcc702afb78110ca75138f;p=bin.git debman: With a version of debget that supports file: via curl, using it is now feasible. --- diff --git a/debman b/debman index 76c0b35..04fe31a 100755 --- a/debman +++ b/debman @@ -83,12 +83,13 @@ TEMPDIR=`mktemp -dt debman.XXXXXXXXXX` trap 'rm -rf "$TEMPDIR"' EXIT ERR HUP INT QUIT TERM if [ -n "$PACKAGE" ]; then - # This duplicates debget; if an option is added there to use an - # externally-specified filename then we can use it instead. - FILENAME="$TEMPDIR/$PACKAGE.deb" - wget -O "$FILENAME" \ - $(apt-get -q2 --print-uris --reinstall install "$PACKAGE" | \ - sed -ne "\$s/^'\([^']*\)'.*$/\1/p") + (cd "$TEMPDIR" && debget "$PACKAGE") + # There should be at most one file in $TEMPDIR now. + FILENAME="`find \"$TEMPDIR\" -name \*.deb -print`" + if [ -z "$FILENAME" ]; then + echo "Failed to fetch package $PACKAGE; exiting." >&2 + exit 1 + fi fi # Ignore errors from tar (though not dpkg). They'll generally just be of the