mirror of
git://code.qt.io/qt/qt5.git
synced 2026-05-09 12:37:50 +08:00
Do not complain about existing empty files
Sometimes we pre-create the target filename using mktemp. In that case of course the hash will not match, so avoid comparing. Change-Id: Id0feb0178d659e03f5ceb000f738167cdc28a3ec Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
This commit is contained in:
@@ -100,10 +100,18 @@ DownloadURL () {
|
||||
targetFile=$4
|
||||
fi
|
||||
|
||||
# If a non-empty file already exists
|
||||
if [ -s "$targetFile" ]
|
||||
then
|
||||
if VerifyHash "$targetFile" "$expectedHash"
|
||||
then
|
||||
echo "Skipping download, found and validated existing file: $targetFile"
|
||||
return
|
||||
else
|
||||
echo "WARNING: Non-empty but different file found at destination; will re-download and overwrite file: $targetFile"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Downloading from primary URL: $url"
|
||||
if ! Download "$url" "$targetFile"
|
||||
then
|
||||
@@ -115,5 +123,4 @@ DownloadURL () {
|
||||
fi
|
||||
fi
|
||||
VerifyHash "$targetFile" "$expectedHash"
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user