summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2021-04-05 09:03:23 +0100
committerLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2021-04-05 09:03:23 +0100
commit6c8e73ae2f8a2dfacb63d892ff676a0dee125777 (patch)
treed8dcb4840b0a83eed2f7c8e1ad518907808d062a
parent4229b4ac4889811da2776253c3e287ca9b173c46 (diff)
downloadmidipix_build-6c8e73ae2f8a2dfacb63d892ff676a0dee125777.tar.bz2
midipix_build-6c8e73ae2f8a2dfacb63d892ff676a0dee125777.tar.xz
subr.rtl/rtl_fetch.subr:rtl_fetch_url_wget(): log actual SHA256 message digest of downloaded file on hash mismatch.
-rw-r--r--subr.rtl/rtl_fetch.subr10
1 files changed, 8 insertions, 2 deletions
diff --git a/subr.rtl/rtl_fetch.subr b/subr.rtl/rtl_fetch.subr
index 255c23f0..1b230b9d 100644
--- a/subr.rtl/rtl_fetch.subr
+++ b/subr.rtl/rtl_fetch.subr
@@ -128,8 +128,14 @@ rtl_fetch_url_wget() {
rtl_log_msg warning "Warning: hash mismatch for URL \`%s', retrying with alternative URL... (from build variables: %s.)"\
"${_url}" "${_sha256sum_src}";
else
- rtl_log_msg fatal "Error: hash mismatch for URL \`%s' (from build variables: %s.)"\
- "${_url}" "${_sha256sum_src}";
+ if _sha256sum_target="$(sha256sum "${_target_fname_full}" |\
+ awk '{print $1}' 2>/dev/null)"; then
+ rtl_log_msg fatal "Error: hash mismatch for URL \`%s' (should be: %s vs.: %s.)"\
+ "${_url}" "${_sha256sum_src}" "${_sha256sum_target}";
+ else
+ rtl_log_msg fatal "Error: hash mismatch for URL \`%s' (should be: %s.)"\
+ "${_url}" "${_sha256sum_src}";
+ fi;
rtl_fileop rm "${_target_fname_full}"; break;
fi; ;;
*) if [ "${_urls_count}" -ge 1 ]; then