diff options
author | Jeffrey Walton <noloader@gmail.com> | 2022-02-15 22:26:32 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2022-02-15 22:26:32 -0500 |
commit | 5c68c63fd9c176f1cf7c2765b06c8998fa9bbd8a (patch) | |
tree | 4921d7611ba162457e753f3290ce16c2cc7692fb /TestScripts | |
parent | 3d9245db91a4f46c279859a5394e3b2372d1553c (diff) | |
download | cryptopp-git-5c68c63fd9c176f1cf7c2765b06c8998fa9bbd8a.tar.gz |
Use curl or wget for download
Diffstat (limited to 'TestScripts')
-rwxr-xr-x | TestScripts/cryptest.sh | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/TestScripts/cryptest.sh b/TestScripts/cryptest.sh index 4a843698..2ce39500 100755 --- a/TestScripts/cryptest.sh +++ b/TestScripts/cryptest.sh @@ -7821,16 +7821,24 @@ fi # Test latest zip with unzip -a if true; then + if command -v wget &>/dev/null; then + FETCH_CMD="wget -q -O" + elif command -v wget &>/dev/null; then + FETCH_CMD="curl -s -o" + else + FETCH_CMD="wget-and-curl-not-found" + fi + major=8; minor=6; rev=0 - base="cryptopp${major}${minor}${rev}" - filename="${base}.zip" + filebase="cryptopp${major}${minor}${rev}" + filename="${filebase}.zip" url="https://cryptopp.com/${filename}" - rm -rf "${base}" 2>/dev/null - if wget -q -O ${filename} "${url}"; + rm -rf "${filebase}" 2>/dev/null + if ${FETCH_CMD} ${filename} "${url}"; then - unzip -aoq "${filename}" -d "${base}" - cd "${base}" || exit 1 + unzip -aoq "${filename}" -d "${filebase}" + cd "${filebase}" || exit 1 ############################################ # Debug build @@ -7896,7 +7904,9 @@ if true; then fi cd ../ || exit 1 - rm -rf "${base}" + rm -rf "${filebase}" + else + FAILED_LIST+=("Latest zip, unzip -a") fi fi |