From e863643a43f1bac0335d3fb63dbbfec720d68cf9 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 26 Sep 2026 14:30:24 -0400 Subject: [PATCH] Use curl instead of wget in build scripts curl is already required, so drop wget as a build requirement. build_autoupdate.sh now checks the HTTP status code for its ETag cache instead of relying on wget not creating the file on a 304. --- app/scripts/check_requirements | 3 --- app/scripts/get_commit_files | 2 +- app/update-packaging/build_autoupdate.sh | 10 +++++++--- app/win/download-nsis-plugins | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/scripts/check_requirements b/app/scripts/check_requirements index 47798bd9ff..f6ab28184b 100755 --- a/app/scripts/check_requirements +++ b/app/scripts/check_requirements @@ -56,9 +56,6 @@ which python3 || { $FAIL_CMD; FAILED=1; } echo -n "Checking for curl: " which curl || { $FAIL_CMD; FAILED=1; } -echo -n "Checking for wget: " -which wget || { $FAIL_CMD; FAILED=1; } - echo -n "Checking for zip: " which zip || { $FAIL_CMD; FAILED=1; } diff --git a/app/scripts/get_commit_files b/app/scripts/get_commit_files index 53368e4a32..0c8a4c7f6a 100755 --- a/app/scripts/get_commit_files +++ b/app/scripts/get_commit_files @@ -14,7 +14,7 @@ hash="$1" tmpdir=`mktemp -d` cd $tmpdir -wget -O build.zip "https://$S3_BUCKET.s3.amazonaws.com/$S3_CI_ZIP_PATH/$hash.zip" >&2 \ +curl -sS -f -L -o build.zip "https://$S3_BUCKET.s3.amazonaws.com/$S3_CI_ZIP_PATH/$hash.zip" >&2 \ || (echo "ZIP file not found for commit '$hash'" && exit 1) unzip build.zip >&2 rm build.zip diff --git a/app/update-packaging/build_autoupdate.sh b/app/update-packaging/build_autoupdate.sh index e7931ec3ea..b6d08aba23 100755 --- a/app/update-packaging/build_autoupdate.sh +++ b/app/update-packaging/build_autoupdate.sh @@ -215,10 +215,12 @@ for version in "$FROM" "$TO"; do set +e # Cached version is available if [ -n "$ETAG" ]; then - NEW_ETAG=$(wget -nv -S --header "If-None-Match: $ETAG" $URL 2>&1 | awk '/ *ETag: */ {print $2}') + HTTP_CODE=$(curl -sS -L -D headers.txt -o $archive -w '%{http_code}' -H "If-None-Match: $ETAG" "$URL") + NEW_ETAG=$(awk 'tolower($1) == "etag:" {print $2}' headers.txt | tr -d '\r' | tail -n 1) + rm -f headers.txt # If ETag didn't match, cache newly downloaded version - if [ -f $archive ]; then + if [ "$HTTP_CODE" = 200 ]; then echo "ETag for $archive didn't match! -- using new version" rm -f "$CACHE_DIR/$archive.etag" cp $archive "$CACHE_DIR/" @@ -229,7 +231,9 @@ for version in "$FROM" "$TO"; do cp "$CACHE_DIR/$archive" . fi else - NEW_ETAG=$(wget -nv -S $URL 2>&1 | awk '/ *ETag: */ {print $2}') + curl -sS -f -L -D headers.txt -o $archive "$URL" + NEW_ETAG=$(awk 'tolower($1) == "etag:" {print $2}' headers.txt | tr -d '\r' | tail -n 1) + rm -f headers.txt # Save archive to cache rm -f "$CACHE_DIR/$archive.etag" diff --git a/app/win/download-nsis-plugins b/app/win/download-nsis-plugins index 7a7d526788..d7986efe03 100755 --- a/app/win/download-nsis-plugins +++ b/app/win/download-nsis-plugins @@ -20,7 +20,7 @@ ROOT_DIR="$(dirname "$SCRIPT_DIR")" #mkdir -p nsis #cd nsis #for plugin in $plugins; do -# wget $plugin +# curl -fsSLO $plugin #done # #unzip_cmd="unzip -d Plugins -j"