use ruby script instead of shasum command
This commit is contained in:
parent
f4156378d8
commit
dc37364248
@ -756,7 +756,14 @@ EOS
|
|||||||
mkdir -p "${HOMEBREW_CACHE}/api"
|
mkdir -p "${HOMEBREW_CACHE}/api"
|
||||||
if [[ -f "${HOMEBREW_CACHE}/api/formula.json" ]]
|
if [[ -f "${HOMEBREW_CACHE}/api/formula.json" ]]
|
||||||
then
|
then
|
||||||
INITIAL_JSON_SHASUM="$(shasum -a 256 "${HOMEBREW_CACHE}"/api/formula.json)"
|
INITIAL_JSON_SHASUM="$(
|
||||||
|
ruby <<EOSCRIPT
|
||||||
|
require 'digest/sha2'
|
||||||
|
digest = Digest::SHA256.new
|
||||||
|
File.open('${HOMEBREW_CACHE}/api/formula.json') { |f| digest.update(f.read) }
|
||||||
|
puts digest.hexdigest
|
||||||
|
EOSCRIPT
|
||||||
|
)"
|
||||||
fi
|
fi
|
||||||
curl \
|
curl \
|
||||||
"${CURL_DISABLE_CURLRC_ARGS[@]}" \
|
"${CURL_DISABLE_CURLRC_ARGS[@]}" \
|
||||||
@ -768,7 +775,14 @@ EOS
|
|||||||
curl_exit_code=$?
|
curl_exit_code=$?
|
||||||
if [[ ${curl_exit_code} -eq 0 ]]
|
if [[ ${curl_exit_code} -eq 0 ]]
|
||||||
then
|
then
|
||||||
CURRENT_JSON_SHASUM="$(shasum -a 256 "${HOMEBREW_CACHE}"/api/formula.json)"
|
CURRENT_JSON_SHASUM="$(
|
||||||
|
ruby <<EOSCRIPT
|
||||||
|
require 'digest/sha2'
|
||||||
|
digest = Digest::SHA256.new
|
||||||
|
File.open('${HOMEBREW_CACHE}/api/formula.json') { |f| digest.update(f.read) }
|
||||||
|
puts digest.hexdigest
|
||||||
|
EOSCRIPT
|
||||||
|
)"
|
||||||
if [[ "${INITIAL_JSON_SHASUM}" != "${CURRENT_JSON_SHASUM}" ]]
|
if [[ "${INITIAL_JSON_SHASUM}" != "${CURRENT_JSON_SHASUM}" ]]
|
||||||
then
|
then
|
||||||
HOMEBREW_UPDATED="1"
|
HOMEBREW_UPDATED="1"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user