diff options
-rwxr-xr-x | scripts/root/plumbing | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/root/plumbing b/scripts/root/plumbing index 0bb735ee..ff302803 100755 --- a/scripts/root/plumbing +++ b/scripts/root/plumbing @@ -8,15 +8,15 @@ mkdir -p "${DOWNLOAD:=$PWD/root_download}" || exit 1 ### Functions to download, extract, and clean up after source packages. # Usage: download HASH URL -# Grabs source from URL confirming SHA1 hash (Basically == "wget $2") -# You can stick extracted source in $DOWNLOAD and build will use that instead +# Grabs source from URL confirming SHA1 hash (Basically "wget $2") +# If extracted source is in $DOWNLOAD (no version) build will use that instead download() { FILE="$(basename "$2")" [ -d "$DOWNLOAD/${FILE/-*/}" ] && echo "$FILE" local && return 0 X=0; while true; do [ "$(sha1sum < "$DOWNLOAD/$FILE" 2>/dev/null)" == "$1 -" ] && echo "$FILE" confirmed && break - rm -f $DOWNLOAD/${FILE/-[0-9]*/}-[0-9]* || break + rm -f $DOWNLOAD/${FILE/-[0-9]*/}-[0-9]* || exit 1 [ $X -eq 0 ] && X=1 || exit 1 wget "$2" -O "$DOWNLOAD/$FILE" done |