Fix shellcheck complaints about provisioning scripts

Also adds executable attributes to shell scripts that were missing it.

Change-Id: Id52ef495147fdbfb5cb1a1f711fac530e0e85f3b
Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Tony Sarajärvi
2023-03-29 12:04:54 +00:00
parent ddef5cc5f2
commit 620666bce4
263 changed files with 457 additions and 422 deletions

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Copyright (C) 2019 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
@@ -21,9 +21,12 @@ Download () {
url="$1"
targetFile="$2"
command -v curl >/dev/null \
&& curl --fail -L --retry 5 --retry-delay 5 -o "$targetFile" "$url" \
|| wget --tries 5 -O "$targetFile" "$url"
if command -v curl >/dev/null
then
curl --fail -L --retry 5 --retry-delay 5 -o "$targetFile" "$url"
else
wget --tries 5 -O "$targetFile" "$url"
fi
}
VerifyHash () {
@@ -61,10 +64,10 @@ DownloadURL () {
url2=$2
expectedHash=$3
# Optional argument $4: destination filename
if [ x"$4" = x ]
if [ -z "$4" ]
then
# defaults to the last component of $url
targetFile=$(echo $url | sed 's|^.*/||')
targetFile="${url/*\//}"
else
targetFile=$4
fi