mirror of
git://code.qt.io/qt/qt5.git
synced 2026-01-04 22:17:45 +08:00
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>
33 lines
1.0 KiB
Bash
Executable File
33 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Copyright (C) 2017 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
|
|
|
|
set -ex
|
|
|
|
function InstallPKGFromURL {
|
|
url=$1
|
|
url_alt=$2
|
|
expectedSha1=$3
|
|
targetDirectory=$4
|
|
|
|
echo "Creating temporary file"
|
|
package_basename="${url/*\//}"
|
|
tmpdir=$(mktemp -d)
|
|
targetFile="$tmpdir/$package_basename"
|
|
echo "Downloading PKG from primary URL '$url'"
|
|
curl --fail -L --retry 5 --retry-delay 5 -o "$targetFile" "$url" || (
|
|
echo "Failed to download '$url' multiple times"
|
|
echo "Downloading PKG from alternative URL '$url_alt'"
|
|
curl --fail -L --retry 5 --retry-delay 5 -o "$targetFile" "$url_alt"
|
|
)
|
|
echo "Checking SHA1 on PKG '$targetFile'"
|
|
echo "$expectedSha1 *$targetFile" > "$targetFile".sha1
|
|
/usr/bin/shasum --check "$targetFile".sha1
|
|
echo "Run installer on PKG"
|
|
sudo installer -package "$targetFile" -target "$targetDirectory"
|
|
|
|
rm -f "$targetFile".sha1
|
|
rm -f "$targetFile"
|
|
rmdir "$tmpdir"
|
|
}
|