From bb9739773ccd2844bad5e8c0124405acb3315ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Thu, 22 Feb 2018 15:28:20 +0100 Subject: Simplify openssl_for_android_linux provisioning script The script was over-engineered. The new version provides the same functionality while removing uninteresting postmortem messages. In addition try_catch.sh has a bug that injects set +e So it is good to avoid using it. Change-Id: I9e26e8fedad71d40270fe94695d5e1c09c3d9023 Reviewed-by: Oliver Wolff --- .../common/linux/openssl_for_android_linux.sh | 40 +++++----------------- 1 file changed, 9 insertions(+), 31 deletions(-) (limited to 'coin') diff --git a/coin/provisioning/common/linux/openssl_for_android_linux.sh b/coin/provisioning/common/linux/openssl_for_android_linux.sh index e9f50b87..30022c39 100755 --- a/coin/provisioning/common/linux/openssl_for_android_linux.sh +++ b/coin/provisioning/common/linux/openssl_for_android_linux.sh @@ -36,7 +36,6 @@ # This script install OpenSSL from sources. # Requires GCC and Perl to be in PATH. -source "${BASH_SOURCE%/*}/../unix/try_catch.sh" source "${BASH_SOURCE%/*}/../unix/DownloadURL.sh" source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" @@ -51,37 +50,16 @@ sha="36af23887402a5ea4ebef91df8e61654906f58f2" # QTQAINFRA-1436 opensslHome="${installFolder}openssl-1.0.2" -ExceptionDownload=99 -ExceptionTar=100 -ExceptionConfig=101 +DownloadURL "$cachedUrl" "$officialUrl" "$sha" "$targetFile" -try -( - (DownloadURL "$cachedUrl" "$officialUrl" "$sha" "$targetFile") || throw $ExceptionDownload +tar -xzf "$targetFile" -C "$installFolder" +# This rename should be removed once hard coded path from Coin is fixed. (QTQAINFRA-1436) +mv "${opensslHome}g" "${opensslHome}" +pushd "$opensslHome" - tar -xzf "$targetFile" -C "$installFolder" || throw $ExceptionTar - # This rename should be removed once hard coded path from Coin is fixed. (QTQAINFRA-1436) - mv "${opensslHome}g" "${opensslHome}" - pushd "$opensslHome" - perl Configure shared android || throw $ExceptionConfig +echo "Running configure" +perl Configure shared android - SetEnvVar "OPENSSL_ANDROID_HOME" "$opensslHome" +SetEnvVar "OPENSSL_ANDROID_HOME" "$opensslHome" - echo "OpenSSL for Android = $version" >> ~/versions.txt -) -catch || { - case $ex_code in - $ExceptionDownload) - exit 1; - ;; - $ExceptionTar) - echo "Failed to extract $targetFile" - exit 1; - ;; - $ExceptionConfig) - echo "Failed to run 'config'." - exit 1; - ;; - esac - -} +echo "OpenSSL for Android = $version" >> ~/versions.txt -- cgit v1.2.3