aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/common/unix
diff options
context:
space:
mode:
Diffstat (limited to 'coin/provisioning/common/unix')
-rwxr-xr-xcoin/provisioning/common/unix/DownloadURL.sh4
-rw-r--r--coin/provisioning/common/unix/common.sourced.sh26
-rwxr-xr-xcoin/provisioning/common/unix/install-openssl.sh4
3 files changed, 27 insertions, 7 deletions
diff --git a/coin/provisioning/common/unix/DownloadURL.sh b/coin/provisioning/common/unix/DownloadURL.sh
index 0579451f..ac1fd971 100755
--- a/coin/provisioning/common/unix/DownloadURL.sh
+++ b/coin/provisioning/common/unix/DownloadURL.sh
@@ -99,9 +99,9 @@ DownloadURL () {
if ! Download "$url" "$targetFile"
then
echo "FAIL! to download, trying alternative URL: $url2" 1>&2
- if ! Download "$url" "$targetFile"
+ if ! Download "$url2" "$targetFile"
then
- echo 'FAIL! to download even from alternative url' 1>&2
+ echo 'FAIL! to download even from alternative URL' 1>&2
return 1
fi
fi
diff --git a/coin/provisioning/common/unix/common.sourced.sh b/coin/provisioning/common/unix/common.sourced.sh
index a52880b2..aca5dd04 100644
--- a/coin/provisioning/common/unix/common.sourced.sh
+++ b/coin/provisioning/common/unix/common.sourced.sh
@@ -65,8 +65,10 @@ fatal () {
fi
}
+# Takes one argument which should be the filename of this script. Returns true
+# if the script is being sourced, false if the script is being executed.
is_script_executed () {
- [ x"$(basename "$0")" = x"$1" ]
+ [ x"$(basename $(echo "$0" | sed s/^-//))" = x"$1" ]
}
@@ -74,6 +76,25 @@ is_script_executed common.sourced.sh \
&& fatal "Script common.sourced.sh should always be sourced, not executed"
+_detect_linux_OS_ID () {
+ if [ -f /etc/os-release ]
+ then
+ . /etc/os-release
+ PROVISIONING_OS_ID="$ID"
+ elif [ -f /etc/redhat-release ]
+ then
+ case "$(cat /etc/redhat-release)" in
+ "Red Hat Enterprise Linux"*)
+ PROVISIONING_OS_ID="rhel"
+ ;;
+ "CentOS Linux"*)
+ PROVISIONING_OS_ID="centos"
+ ;;
+ *) fatal "Unknown string in /etc/redhat-release" ;;
+ esac
+ fi
+}
+
set_common_environment () {
# Unfortunately we can't find the provisioning directory from a sourced
# script in a portable way
@@ -86,8 +107,7 @@ set_common_environment () {
case "$uname_s" in
Linux)
PROVISIONING_OS=linux
- . /etc/os-release
- PROVISIONING_OS_ID="$ID"
+ _detect_linux_OS_ID
case "$PROVISIONING_OS_ID" in
suse|sles|opensuse*)
CMD_PKG_INSTALL="sudo zypper -nq install"
diff --git a/coin/provisioning/common/unix/install-openssl.sh b/coin/provisioning/common/unix/install-openssl.sh
index 01a20935..08a3390b 100755
--- a/coin/provisioning/common/unix/install-openssl.sh
+++ b/coin/provisioning/common/unix/install-openssl.sh
@@ -42,11 +42,11 @@ source "${BASH_SOURCE%/*}/../unix/DownloadURL.sh"
# shellcheck source=../unix/SetEnvVar.sh
source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh"
-version="1.1.1b"
+version="1.1.1d"
officialUrl="https://www.openssl.org/source/openssl-$version.tar.gz"
cachedUrl="http://ci-files01-hki.intra.qt.io/input/openssl/openssl-$version.tar.gz"
targetFile="/tmp/openssl-$version.tar.gz"
-sha="e9710abf5e95c48ebf47991b10cbb48c09dae102"
+sha="056057782325134b76d1931c48f2c7e6595d7ef4"
opensslHome="${HOME}/openssl-${version}"
opensslSource="${opensslHome}-src"
DownloadURL "$cachedUrl" "$officialUrl" "$sha" "$targetFile"