aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuha Karjalainen <juha.karjalainen@qt.io>2019-01-07 13:00:04 +0200
committerJuha Karjalainen <juha.karjalainen@qt.io>2019-01-09 09:14:02 +0000
commit7028ee31848b3f5d7e722a2bc91f5dbcb88f4562 (patch)
treec416f67c9227de58a2769a19c55beda79e547b77
parentff127412993e80df0d3a22d7d2660bd2300219a4 (diff)
Fix broken provisioning script DownloadURL.sh
DownloadURL returns 0 even when alt download fails. Task-number: QTQAINFRA-2501 Change-Id: Id2fb1e0b4ff12a48b6adb27291f55fc129296233 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
-rwxr-xr-xcoin/provisioning/common/unix/DownloadURL.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/coin/provisioning/common/unix/DownloadURL.sh b/coin/provisioning/common/unix/DownloadURL.sh
index 2d82af58..996c99da 100755
--- a/coin/provisioning/common/unix/DownloadURL.sh
+++ b/coin/provisioning/common/unix/DownloadURL.sh
@@ -40,6 +40,8 @@
# If called directly from another script, it will exit the parent script
# as well, if not called in its own subshell with parentheses.
+set -ex
+
function DownloadURL {
url=$1
url_alt=$2
@@ -47,11 +49,11 @@ function DownloadURL {
targetFile=$4
echo "Downloading from primary URL '$url'"
- curl --fail -L --retry 5 --retry-delay 5 -o "$targetFile" "$url" || (
+ curl --fail -L --retry 5 --retry-delay 5 -o "$targetFile" "$url" || {
echo "Failed to download '$url' multiple times"
echo "Downloading from alternative URL '$url_alt'"
- curl --fail -L --retry 5 --retry-delay 5 -o "$targetFile" "$url_alt"
- )
+ curl --fail -L --retry 5 --retry-delay 5 -o "$targetFile" "$url_alt" || { echo 'Failed to download even from alternative url'; exit 1; }
+ }
echo "Checking SHA1 on PKG '$targetFile'"
echo "$expectedSha1 *$targetFile" > "$targetFile.sha1"