Skip to content

Commit

Permalink
compute_sha2: drop support for OS X Leopard
Browse files Browse the repository at this point in the history
When computing the SHA-2 checksum, `openssl dgst` is a potential candidate if
openssl was found in PATH. Previously, openssl from Homebrew would also get
explicitly added to the candidates list because, historically, Homebrew did not
link it to PATH, OS X Leopard did not have `shasum`, and system openssl could
not calculate sha256 checksums.

This drops support for OS X Leopard which last had an update 15 years ago.

Ref. b396ad7
  • Loading branch information
mislav committed Jan 22, 2025
1 parent fdcfac8 commit eabf640
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions bin/ruby-build
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,7 @@ compute_sha2() {
output="$(shasum -a 256 -b)" || return 1
echo "${output% *}"
elif type openssl &>/dev/null; then
local openssl
openssl="$(command -v "$(brew --prefix openssl 2>/dev/null || true)"/bin/openssl openssl | head -1)"
output="$("$openssl" dgst -sha256 2>/dev/null)" || return 1
output="$(openssl dgst -sha256 2>/dev/null)" || return 1
echo "${output##* }"
elif type sha256sum &>/dev/null; then
output="$(sha256sum -b)" || return 1
Expand Down

0 comments on commit eabf640

Please sign in to comment.