From 29e73bf0a06d08a8363c932f0479fb7e56fc979f Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 8 Jun 2020 11:49:44 -0500 Subject: Tweak comments and error handling --- scripts/root/plumbing | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/root') 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 -- cgit v1.2.3