aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/common/macos/install-commandlinetools.sh
diff options
context:
space:
mode:
authorTony Sarajärvi <tony.sarajarvi@qt.io>2018-03-08 13:30:24 +0200
committerLiang Qi <liang.qi@qt.io>2018-04-18 18:14:37 +0000
commit41c372c010ad830ddc9d87cd09ac250196fbab18 (patch)
tree67ef39c9a568092cea6926ef7f4321ef304c68db /coin/provisioning/common/macos/install-commandlinetools.sh
parent34e9e68372594b6748e7c5a59377e4155b599440 (diff)
Remove try_catch codes from common macOS scripts
Change-Id: I66291e2da5514499387b61e01ad85a652cd24d7b Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io> (cherry picked from commit a98b0f3d7989bedf6f0bcc1a83b52aad1d3baa3e) Reviewed-by: Simo Fält <simo.falt@qt.io>
Diffstat (limited to 'coin/provisioning/common/macos/install-commandlinetools.sh')
-rwxr-xr-xcoin/provisioning/common/macos/install-commandlinetools.sh56
1 files changed, 15 insertions, 41 deletions
diff --git a/coin/provisioning/common/macos/install-commandlinetools.sh b/coin/provisioning/common/macos/install-commandlinetools.sh
index d57e1d2f..18ff1036 100755
--- a/coin/provisioning/common/macos/install-commandlinetools.sh
+++ b/coin/provisioning/common/macos/install-commandlinetools.sh
@@ -33,56 +33,30 @@
##
#############################################################################
source "${BASH_SOURCE%/*}/../unix/DownloadURL.sh"
-source "${BASH_SOURCE%/*}/../unix/try_catch.sh"
set -ex
# Command line tools is need by homebrew
function InstallCommandLineTools {
-
- ExceptionMount=101
- ExceptionInstall=102
- ExceptionUnmount=103
-
url=$1
url_alt=$2
expectedSha1=$3
packageName=$4
version=$5
- try
- (
- DownloadURL $url $url_alt $expectedSha1 /tmp/$packageName
- echo "Mounting $packageName"
- hdiutil attach /tmp/$packageName || throw $ExceptionMount
- cd "/Volumes/Command Line Developer Tools"
- echo "Installing"
- sudo installer -verbose -pkg *.pkg -target / || throw $ExceptionInstall
- cd /
- # Let's fait for 5 second before unmounting. Sometimes resource is busy and cant be unmounted
- sleep 3
- echo "Unmounting"
- umount /Volumes/Command\ Line\ Developer\ Tools/ || throw $ExceptionUnmount
- echo "Removing $packageName"
- rm /tmp/$packageName
-
- echo "Command Line Tools = $version" >> ~/versions.txt
- )
- catch || {
- case $ex_code in
- $ExceptionMount)
- echo "Failed to mount"
- exit 1;
- ;;
- $ExceptionInstall)
- echo "Failed to install"
- exit 1;
- ;;
- $ExceptionUnmount)
- echo "Failed to unmount"
- exit 1;
-
- esac
- }
-
+ DownloadURL $url $url_alt $expectedSha1 /tmp/$packageName
+ echo "Mounting $packageName"
+ hdiutil attach /tmp/$packageName
+ cd "/Volumes/Command Line Developer Tools"
+ echo "Installing"
+ sudo installer -verbose -pkg *.pkg -target /
+ cd /
+ # Let's fait for 5 second before unmounting. Sometimes resource is busy and cant be unmounted
+ sleep 3
+ echo "Unmounting"
+ umount /Volumes/Command\ Line\ Developer\ Tools/
+ echo "Removing $packageName"
+ rm /tmp/$packageName
+
+ echo "Command Line Tools = $version" >> ~/versions.txt
}