Provisioning: Fix helper function's mktemp in macOS 10.10

It seems that macOS 10.10 has a non standard mktemp command. It doesn't
work as expected but prints usage and exit instead.

Change-Id: I37be6eb01474466c2b6bbae4f38876673bd9c295
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
This commit is contained in:
Simo Fält
2017-08-25 09:52:12 +03:00
committed by Simon Hausmann
parent 44cf10382c
commit a3f4bf703b

View File

@@ -74,7 +74,12 @@ function InstallAppFromCompressedFileFromURL {
echo "Extension for file: $extension"
echo "Creating temporary file and directory"
targetFile=$(mktemp "$TMPDIR$(uuidgen).$extension") || throw $ExceptionCreateTmpFile
targetDirectory=$(mktemp -d) || throw $ExceptionCreateTmpDirectory
# macOS 10.10 mktemp does require prefix
if [[ $OSTYPE == "darwin14" ]]; then
targetDirectory=$(mktemp -d -t '10.10') || throw $ExceptionCreateTmpDirectory
else
targetDirectory=$(mktemp -d) || throw $ExceptionCreateTmpDirectory
fi
DownloadURL "$url" "$url_alt" "$expectedSha1" "$targetFile"
echo "Uncompress $targetFile"
case $extension in