From 4807ea751a3be301f24e1d68a79bd0b461fddb1b Mon Sep 17 00:00:00 2001 From: CvH Date: Tue, 10 Aug 2021 13:08:51 +0200 Subject: [PATCH] scripts/get_archive: allow changing sha256 on the fly --- scripts/get_archive | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/get_archive b/scripts/get_archive index dd0e47f2cf..626a6f4652 100755 --- a/scripts/get_archive +++ b/scripts/get_archive @@ -39,8 +39,13 @@ while [ ${NBWGET} -gt 0 -a ${NBCHKS} -gt 0 ]; do [ -z "${PKG_SHA256}" -o "${PKG_SHA256}" = "${CALC_SHA256}" ] && break 2 - build_msg "CLR_WARNING" "WARNING" "Incorrect checksum calculated on downloaded file: got ${CALC_SHA256} wanted ${PKG_SHA256}" - NBCHKS=$((NBCHKS - 1)) + if [ "${CHANGE_HASH}" = "yes" ]; then + sed -e "s|^PKG_SHA256=.*|PKG_SHA256=\"${CALC_SHA256}\"|" -i "${PKG_DIR}/package.mk" + break 2 + else + build_msg "CLR_WARNING" "WARNING" "Incorrect checksum calculated on downloaded file: got ${CALC_SHA256} wanted ${PKG_SHA256}" + NBCHKS=$((NBCHKS - 1)) + fi fi done NBWGET=$((NBWGET - 1))