From e82cb6b4186cec5c6c103bfdd0dbf0a9257ac5e1 Mon Sep 17 00:00:00 2001 From: Brett Jia Date: Sun, 5 May 2024 23:24:17 -0400 Subject: [PATCH] try different way to verify on freebsd --- scripts/utils.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/utils.sh b/scripts/utils.sh index 06c6ecf8..5446e88f 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -7,11 +7,20 @@ echo "Selected portable-python-cmake-buildsystem branch: ${CMAKE_BUILDSYSTEM_BRA SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" -function verify_checksum () { - file="$1" - filename=$(basename $file) - echo "$(cat ${SCRIPT_DIR}/../checksums/$file.sha256)" | sha256sum -c -} +if [[ "${PLATFORM}" == "freebsd"* ]]; then + function verify_checksum () { + file="$1" + filename=$(basename $file) + sum=$(cat ${SCRIPT_DIR}/../checksums/$file.sha256 | awk '{print $1}') + sha256sum -c $sum $file + } +else + function verify_checksum () { + file="$1" + filename=$(basename $file) + echo "$(cat ${SCRIPT_DIR}/../checksums/$file.sha256)" | sha256sum -c + } +fi function download_and_verify () { file="$1"