mirror of
https://github.com/rbenv/ruby-build.git
synced 2025-09-30 04:51:19 +02:00
Try openssl from Homebrew when calculating SHA-256 checksums
This makes checksums possible on Leopard where `shasum` is unavailable and system openssl doesn't support `dgst -sha256`. Fixes #656
This commit is contained in:
parent
e7810a61eb
commit
b396ad7cd1
1 changed files with 2 additions and 1 deletions
|
@ -190,7 +190,8 @@ compute_sha2() {
|
|||
output="$(shasum -a 256 -b)" || return 1
|
||||
echo "${output% *}"
|
||||
elif type openssl &>/dev/null; then
|
||||
output="$(openssl dgst -sha256)" || return 1
|
||||
local openssl="$(command -v "$(brew --prefix openssl 2>/dev/null)"/bin/openssl openssl | head -1)"
|
||||
output="$("$openssl" dgst -sha256 2>/dev/null)" || return 1
|
||||
echo "${output##* }"
|
||||
elif type sha256sum &>/dev/null; then
|
||||
output="$(sha256sum --quiet)" || return 1
|
||||
|
|
Loading…
Reference in a new issue