mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-01-31 01:25:18 +01:00
CI: download dependency if the filename is the same but the checksum changed
This commit is contained in:
@@ -28,11 +28,23 @@ download_and_verify()
|
||||
correctChecksum="$2"
|
||||
algo="$3"
|
||||
fileName="$4"
|
||||
path="$DEPS_CACHE_DIR/$fileName"
|
||||
|
||||
for _ in 1 2 3; do
|
||||
[ -e "$DEPS_CACHE_DIR/$fileName" ] || curl -fLo "$DEPS_CACHE_DIR/$fileName" "$url"
|
||||
fileChecksum=$("${algo}sum" "$DEPS_CACHE_DIR/$fileName" | awk '{ print $1 }')
|
||||
# Check if the file exists and the checksum is correct
|
||||
if [ -e "$path" ]; then
|
||||
fileChecksum=$("${algo}sum" "$path" | awk '{ print $1 }')
|
||||
[ "$fileChecksum" = "$correctChecksum" ] && return 0
|
||||
fi
|
||||
|
||||
# Otherwise download the file
|
||||
curl -fLo "$path" "$url"
|
||||
|
||||
# Check again if the file exists and the checksum is correct
|
||||
if [ -e "$path" ]; then
|
||||
fileChecksum=$("${algo}sum" "$path" | awk '{ print $1 }')
|
||||
[ "$fileChecksum" = "$correctChecksum" ] && return 0
|
||||
fi
|
||||
done
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -53,11 +53,23 @@ download_and_verify()
|
||||
correctChecksum="$2"
|
||||
algo="$3"
|
||||
fileName="$4"
|
||||
path="$DEPS_CACHE_DIR/$fileName"
|
||||
|
||||
for _ in 1 2 3; do
|
||||
[ -e "$DEPS_CACHE_DIR/$fileName" ] || curl -fLo "$DEPS_CACHE_DIR/$fileName" "$url"
|
||||
fileChecksum=$("${algo}sum" "$DEPS_CACHE_DIR/$fileName" | awk '{ print $1 }')
|
||||
# Check if the file exists and the checksum is correct
|
||||
if [ -e "$path" ]; then
|
||||
fileChecksum=$("${algo}sum" "$path" | awk '{ print $1 }')
|
||||
[ "$fileChecksum" = "$correctChecksum" ] && return 0
|
||||
fi
|
||||
|
||||
# Otherwise download the file
|
||||
curl -fLo "$path" "$url"
|
||||
|
||||
# Check again if the file exists and the checksum is correct
|
||||
if [ -e "$path" ]; then
|
||||
fileChecksum=$("${algo}sum" "$path" | awk '{ print $1 }')
|
||||
[ "$fileChecksum" = "$correctChecksum" ] && return 0
|
||||
fi
|
||||
done
|
||||
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user