From 2122050b3e7156b3d92179a521a33d9884ef9af5 Mon Sep 17 00:00:00 2001 From: Shiz Date: Wed, 3 Jan 2024 13:33:18 +0100 Subject: [PATCH] buildtoolchain: try fetching using cURL if wget is not available --- buildtoolchain/buildit.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/buildtoolchain/buildit.sh b/buildtoolchain/buildit.sh index cf0ef4e..ef85dbc 100755 --- a/buildtoolchain/buildit.sh +++ b/buildtoolchain/buildit.sh @@ -64,7 +64,13 @@ download() { if [ $DL -eq 1 ]; then echo "Downloading $2..." - wget "$2" -c -O "$1" || die "Could not download $2" + if command -v wget >/dev/null 2>&1; then + wget "$2" -c -O "$1" || die "Could not download $2 using wget" + elif command -v curl >/dev/null 2>&1; then + curl -o "$1" -fL "$2" || die "Could not download $2 using cURL" + else + die "Could not download $2 (no wget or cURL)" + fi fi }