summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitrios Apostolou <jimis@qt.io>2019-11-05 12:09:12 +0100
committerJukka Jokiniva <jukka.jokiniva@qt.io>2019-11-20 12:35:32 +0200
commit74195b12e6863821f133295288e955cfa3d932c9 (patch)
tree556e137b2b45b26003048bc1440c09a59c9f6c21
parent1f1832b5da305ccc5b863ebb6264af0766e91071 (diff)
DownloadURL last argument (targetFile) is now optional
Change-Id: I0864bcb052cddcc9753c056758b6e65fd561d928 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io> (cherry picked from commit 6cc2215b8ce6da477cf23f01ff5b88c0d12c2b88) Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
-rwxr-xr-xcoin/provisioning/common/unix/DownloadURL.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/coin/provisioning/common/unix/DownloadURL.sh b/coin/provisioning/common/unix/DownloadURL.sh
index ac1fd971..5bafc33d 100755
--- a/coin/provisioning/common/unix/DownloadURL.sh
+++ b/coin/provisioning/common/unix/DownloadURL.sh
@@ -89,7 +89,14 @@ DownloadURL () {
url=$1
url2=$2
expectedHash=$3
- targetFile=$4
+ # Optional argument $4: destination filename
+ if [ x"$4" = x ]
+ then
+ # defaults to the last component of $url
+ targetFile=$(echo $url | sed 's|^.*/||')
+ else
+ targetFile=$4
+ fi
if VerifyHash "$targetFile" "$expectedHash"
then