mirror of
git://code.qt.io/qt/qt5.git
synced 2026-02-24 16:05:36 +08:00
Create more meaningful temporary file names
Change-Id: I4bbc94993e51502ea08109a4c99f3e212349ab24 Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
This commit is contained in:
@@ -42,7 +42,9 @@ function InstallPKGFromURL {
|
||||
targetDirectory=$4
|
||||
|
||||
echo "Creating temporary file"
|
||||
targetFile=$(mktemp "$TMPDIR$(uuidgen).pkg")
|
||||
package_basename=$(echo "$url" | sed 's|^.*/||')
|
||||
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"
|
||||
@@ -50,10 +52,12 @@ function InstallPKGFromURL {
|
||||
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 "$expectedSha1 *$targetFile" > "$targetFile".sha1
|
||||
/usr/bin/shasum --check "$targetFile".sha1
|
||||
echo "Run installer on PKG"
|
||||
sudo installer -package "$targetFile" -target "$targetDirectory"
|
||||
echo "Removing file '$targetFile'"
|
||||
rm "$targetFile"
|
||||
|
||||
rm -f "$targetFile".sha1
|
||||
rm -f "$targetFile"
|
||||
rmdir "$tmpdir"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user