aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/common
diff options
context:
space:
mode:
authorDimitrios Apostolou <jimis@qt.io>2019-11-05 12:09:12 +0100
committerDimitrios Apostolou <jimis@qt.io>2019-11-14 08:46:14 +0100
commit6cc2215b8ce6da477cf23f01ff5b88c0d12c2b88 (patch)
tree3488222691bfa9cdd553623c6b746bdedd2dcc0b /coin/provisioning/common
parent569fd1dabc47dccd80331d4f380eae811fd07447 (diff)
DownloadURL last argument (targetFile) is now optional
Change-Id: I0864bcb052cddcc9753c056758b6e65fd561d928 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Diffstat (limited to 'coin/provisioning/common')
-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