Merge pull request #2684 from mistydemeo/add_vendored_sha256
Add vendored sha256
This commit is contained in:
commit
120985e23f
@ -82,6 +82,15 @@ fetch() {
|
|||||||
elif [[ -x "$(which sha256sum)" ]]
|
elif [[ -x "$(which sha256sum)" ]]
|
||||||
then
|
then
|
||||||
sha="$(sha256sum "$CACHED_LOCATION" | cut -d' ' -f1)"
|
sha="$(sha256sum "$CACHED_LOCATION" | cut -d' ' -f1)"
|
||||||
|
elif [[ -x "$(which ruby)" ]]
|
||||||
|
then
|
||||||
|
sha="$(ruby <<EOSCRIPT
|
||||||
|
require 'digest/sha2'
|
||||||
|
digest = Digest::SHA256.new
|
||||||
|
File.open('$CACHED_LOCATION', 'rb') { |f| digest.update(f.read) }
|
||||||
|
puts digest.hexdigest
|
||||||
|
EOSCRIPT
|
||||||
|
)"
|
||||||
else
|
else
|
||||||
odie "Cannot verify the checksum ('shasum' or 'sha256sum' not found)!"
|
odie "Cannot verify the checksum ('shasum' or 'sha256sum' not found)!"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -322,7 +322,7 @@ class Pathname
|
|||||||
|
|
||||||
def sha256
|
def sha256
|
||||||
require "digest/sha2"
|
require "digest/sha2"
|
||||||
incremental_hash(Digest::SHA2)
|
incremental_hash(Digest::SHA256)
|
||||||
end
|
end
|
||||||
|
|
||||||
def verify_checksum(expected)
|
def verify_checksum(expected)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user