File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -126,9 +126,10 @@ function validate-hash {
126
126
local -r file=" $1 "
127
127
local -r expected=" $2 "
128
128
129
- actual=$( sha512sum ${file} | awk ' { print $1 }' ) || true
130
- if [[ " ${actual} " != " ${expected} " ]]; then
131
- echo " == ${file} corrupted, sha512 ${actual} doesn't match expected ${expected} =="
129
+ actual_sha1=$( sha1sum " ${file} " | awk ' { print $1 }' ) || true
130
+ actual_sha512=$( sha512sum " ${file} " | awk ' { print $1 }' ) || true
131
+ if [[ " ${actual_sha1} " != " ${expected} " ]] && [[ " ${actual_sha512} " != " ${expected} " ]]; then
132
+ echo " == ${file} corrupted, sha1 ${actual_sha1} /sha512 ${actual_sha512} doesn't match expected ${expected} =="
132
133
return 1
133
134
fi
134
135
}
@@ -146,7 +147,7 @@ function valid-storage-scope {
146
147
147
148
# Retry a download until we get it. Takes a hash and a set of URLs.
148
149
#
149
- # $1 is the sha512 of the URL. Can be "" if the sha512 is unknown.
150
+ # $1 is the sha512/sha1 hash of the URL. Can be "" if the sha512/sha1 hash is unknown.
150
151
# $2+ are the URLs to download.
151
152
function download-or-bust {
152
153
local -r hash=" $1 "
@@ -168,7 +169,7 @@ function download-or-bust {
168
169
echo " == Hash validation of ${url} failed. Retrying. =="
169
170
else
170
171
if [[ -n " ${hash} " ]]; then
171
- echo " == Downloaded ${url} (SHA512 = ${hash} ) =="
172
+ echo " == Downloaded ${url} (HASH = ${hash} ) =="
172
173
else
173
174
echo " == Downloaded ${url} =="
174
175
fi
You can’t perform that action at this time.
0 commit comments