diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2020-03-24 18:21:20 +0100 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2020-03-25 09:06:48 +0100 |
commit | 332f373a9dece71717f75eb06e6a1fc957f2952b (patch) | |
tree | 6a9f82449b6a1bfbeaf884c059ef987d4690f45a | |
parent | 5236b2e267a58870239673c7ec85e5df0cb8fc8e (diff) | |
download | bitcoin-332f373a9dece71717f75eb06e6a1fc957f2952b.tar.xz |
[scripts] previous_release: improve failed download error message
before:
------------------------------------------------------------
$ contrib/devtools/previous_release.sh -r -b v0.9.5
[...]
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
------------------------------------------------------------
now:
------------------------------------------------------------
$ contrib/devtools/previous_release.sh -r -b v0.9.5
[...]
curl: (22) The requested URL returned error: 404 Not Found
Download failed.
------------------------------------------------------------
-rwxr-xr-x | contrib/devtools/previous_release.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/devtools/previous_release.sh b/contrib/devtools/previous_release.sh index efd035f778..5ddfdb4e73 100755 --- a/contrib/devtools/previous_release.sh +++ b/contrib/devtools/previous_release.sh @@ -139,7 +139,10 @@ pushd "$TARGET" || exit 1 fi URL="https://bitcoin.org/$BIN_PATH/bitcoin-${tag:1}-$PLATFORM.tar.gz" echo "Fetching: $URL" - curl -O $URL + if ! curl -O -f $URL; then + echo "Download failed." + exit 1 + fi tar -zxf "bitcoin-${tag:1}-$PLATFORM.tar.gz" -C "$tag" --strip-components=1 "bitcoin-${tag:1}" rm "bitcoin-${tag:1}-$PLATFORM.tar.gz" fi |