mirror of
https://github.com/zotero/zotero.git
synced 2026-10-02 02:11:33 +00:00
Use curl instead of wget in build scripts
Some checks failed
CI / Build, Upload (push) Has been cancelled
CI / Detect changes (push) Has been cancelled
CI / Utilities Tests (push) Has been cancelled
CI / Test () (push) Has been cancelled
CI / Test (macOS NFS) (push) Has been cancelled
CI / Test (Windows arm64) (push) Has been cancelled
CI / Test (Windows x64) (push) Has been cancelled
Some checks failed
CI / Build, Upload (push) Has been cancelled
CI / Detect changes (push) Has been cancelled
CI / Utilities Tests (push) Has been cancelled
CI / Test () (push) Has been cancelled
CI / Test (macOS NFS) (push) Has been cancelled
CI / Test (Windows arm64) (push) Has been cancelled
CI / Test (Windows x64) (push) Has been cancelled
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.
This commit is contained in:
parent
8c3b967bf9
commit
e863643a43
4 changed files with 9 additions and 8 deletions
|
|
@ -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; }
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue