File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -453,16 +453,33 @@ then
453
453
RUST_URL=" ${RUST_URL} /${CFG_DATE} "
454
454
fi
455
455
456
- verify_hash () {
457
- remote_sha256=" $1 "
458
- local_file=" $2 "
459
-
456
+ download_hash () {
460
457
msg " Downloading ${remote_sha256} "
461
458
remote_sha256=` " ${CFG_CURL} " -f " ${remote_sha256} " `
459
+ if [ -n " ${CFG_SAVE} " ]; then
460
+ echo " ${remote_sha256} " > " ${local_sha_file} "
461
+ fi
462
462
if [ " $? " -ne 0 ]; then
463
463
rm -Rf " ${CFG_TMP_DIR} "
464
464
err " Failed to download ${remote_url} "
465
465
fi
466
+ }
467
+
468
+ verify_hash () {
469
+ remote_sha256=" $1 "
470
+ local_file=" $2 "
471
+ local_sha_file=" ${local_file} .sha256"
472
+
473
+ if [ -n " ${CFG_SAVE} " ]; then
474
+ if [ -f " ${local_sha_file} " ]; then
475
+ msg " Local ${local_sha_file} exists, treating as remote hash"
476
+ remote_sha256=` cat " ${local_sha_file} " `
477
+ else
478
+ download_hash
479
+ fi
480
+ else
481
+ download_hash
482
+ fi
466
483
467
484
msg " Verifying hash"
468
485
local_sha256=$( calculate_hash " ${local_file} " )
You can’t perform that action at this time.
0 commit comments