aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRudi Lee <quadhack@gmail.com>2018-04-26 07:38:45 +0700
committerRudi Lee <quadhack@gmail.com>2018-04-26 07:38:45 +0700
commit6a3c1db30bbdc0d2580a3c787d90811e6bb7823a (patch)
treed938bf2d56c777a0571ca2867661db44404fc8f5 /scripts
parent6d5bf1b2006c50194c768667f86b89152435d853 (diff)
downloadvcpkg-6a3c1db30bbdc0d2580a3c787d90811e6bb7823a.tar.gz
vcpkg-6a3c1db30bbdc0d2580a3c787d90811e6bb7823a.zip
Checking for sha512sum on OS which doesn't have shasum
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bootstrap.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh
index 66efb1d62..58eb9e9fb 100755
--- a/scripts/bootstrap.sh
+++ b/scripts/bootstrap.sh
@@ -29,8 +29,15 @@ vcpkgCheckRepoTool()
vcpkgCheckEqualFileHash()
{
url=$1; filePath=$2; expectedHash=$3
+
+ SHASUM="shasum -a 512" # sha512sum is not available on osx
- actualHash=$(shasum -a 512 "$filePath") # sha512sum not available on osx
+ # checking for sha512sum on os which doesn't have shasum
+ if which sha512sum >/dev/null 2>&1; then
+ SHASUM=sha512sum
+ fi
+
+ actualHash=$("$SHASUM" "$filePath")
actualHash="${actualHash%% *}" # shasum returns [hash filename], so get the first word
if ! [ "$expectedHash" = "$actualHash" ]; then