Skip to content

Commit

Permalink
try different way to verify on freebsd
Browse files Browse the repository at this point in the history
  • Loading branch information
bjia56 committed May 6, 2024
1 parent 52f25dd commit e82cb6b
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit e82cb6b

Please sign in to comment.