mirror of
git://code.qt.io/qt/qt5.git
synced 2026-02-01 19:36:04 +08:00
Provisioning: Fix usage of DownloadURL to throw errors
In case DownloadURL failed it's shasum check, it printed an error and threw an exit 1. This exit 1 was never handled in the calling scripts and went ignored. It was also not passed forward as it was inside a try-catch statement. Change-Id: Iae4fd6aefb75c07623ec86dc570f0a46fec659b4 Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
This commit is contained in:
@@ -42,6 +42,7 @@ source "${BASH_SOURCE%/*}/try_catch.sh"
|
||||
# shellcheck source=DownloadURL.sh
|
||||
source "${BASH_SOURCE%/*}/DownloadURL.sh"
|
||||
|
||||
ExceptionDownload=99
|
||||
ExceptionCreateTmpFile=100
|
||||
ExceptionCreateTmpDirectory=101
|
||||
ExceptionUncompress=102
|
||||
@@ -80,7 +81,7 @@ function InstallAppFromCompressedFileFromURL {
|
||||
else
|
||||
targetDirectory=$(mktemp -d) || throw $ExceptionCreateTmpDirectory
|
||||
fi
|
||||
DownloadURL "$url" "$url_alt" "$expectedSha1" "$targetFile"
|
||||
(DownloadURL "$url" "$url_alt" "$expectedSha1" "$targetFile") || throw $ExceptionDownload
|
||||
echo "Uncompress $targetFile"
|
||||
case $extension in
|
||||
"tar.gz")
|
||||
@@ -103,6 +104,9 @@ function InstallAppFromCompressedFileFromURL {
|
||||
|
||||
catch || {
|
||||
case $ex_code in
|
||||
$ExceptionDownload)
|
||||
exit 1;
|
||||
;;
|
||||
$ExceptionCreateTmpFile)
|
||||
echo "Failed to create temporary file"
|
||||
exit 1;
|
||||
|
||||
Reference in New Issue
Block a user