0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-02 09:46:52 -05:00

use sha256 command instead of sha256sum on FreeBSD

This commit is contained in:
Murray Nesbitt 2022-12-29 22:23:44 -08:00
parent 65de8eeeca
commit 22e9afe40d

View file

@ -32,16 +32,15 @@ check_exists() {
sha256_check() {
# Args: <sha256_hash> <filename>
#
if check_exists sha256sum; then
echo "${1} ${2}" | sha256sum -c
if [ "$(uname)" = "FreeBSD" ]; then
# sha256sum exists on FreeBSD, but takes different arguments than the GNU version
sha256 -c "${1}" "${2}"
elif check_exists sha256sum; then
echo "${1} ${2}" | sha256sum -c
elif check_exists sha256; then
if [ "$(uname)" = "FreeBSD" ]; then
sha256 -c "${1}" "${2}"
else
echo "${1} ${2}" | sha256 -c
fi
echo "${1} ${2}" | sha256 -c
else
echo "${1} ${2}" | shasum -a 256 -c
echo "${1} ${2}" | shasum -a 256 -c
fi
}