File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -244,7 +244,21 @@ create_tmp_dir() {
244
244
probe_need CFG_CURL curl
245
245
probe_need CFG_TAR tar
246
246
probe_need CFG_FILE file
247
- probe_need CFG_SHASUM shasum
247
+
248
+ probe CFG_SHA256SUM sha256sum
249
+ probe CFG_SHASUM shasum
250
+
251
+ if [ -z " $CFG_SHA256SUM " -a -z " $CFG_SHASUM " ]; then
252
+ err " unable to find either sha256sum or shasum"
253
+ fi
254
+
255
+ calculate_hash () {
256
+ if [ -n " $CFG_SHA256SUM " ]; then
257
+ ${CFG_SHA256SUM} $@
258
+ else
259
+ ${CFG_SHASUM} -a 256 $@
260
+ fi
261
+ }
248
262
249
263
CFG_SRC_DIR=" $( cd $( dirname $0 ) && pwd) /"
250
264
CFG_SELF=" $0 "
@@ -474,7 +488,7 @@ verify_hash() {
474
488
fi
475
489
476
490
msg " Verifying hash"
477
- local_sha256=` " ${CFG_SHASUM} " -a 256 " ${local_file} " `
491
+ local_sha256=$( calculate_hash " ${local_file} " )
478
492
if [ " $? " -ne 0 ]; then
479
493
rm -Rf " ${CFG_TMP_DIR} "
480
494
err " Failed to compute hash for ${local_tarball} "
You can’t perform that action at this time.
0 commit comments