From 90347d5da0c28a902fb562cea5a1dfcfdf40ecc3 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 14 May 2022 03:13:28 -0500 Subject: [PATCH] Fall back to /usr/bin/wget when toybox wget wasn't built with https support. --- scripts/root/plumbing | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/root/plumbing b/scripts/root/plumbing index ff302803..5b849828 100755 --- a/scripts/root/plumbing +++ b/scripts/root/plumbing @@ -11,14 +11,14 @@ mkdir -p "${DOWNLOAD:=$PWD/root_download}" || exit 1 # 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")" + local FILE="$(basename "$2")" WGET=wget [ -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]* || exit 1 - [ $X -eq 0 ] && X=1 || exit 1 - wget "$2" -O "$DOWNLOAD/$FILE" + [ $X -eq 0 ] && X=1 || [ $X -eq 1 ] && X=2 WGET=/usr/bin/wget || exit 1 + $WGET "$2" -O "$DOWNLOAD/$FILE" done } -- 2.39.2