aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMisty De Meo2017-05-30 19:10:00 -0700
committerGitHub2017-05-30 19:10:00 -0700
commit120985e23fb4a2bbf4233fe437644fc16402a163 (patch)
treea621c6dfd24169cc830ce7c4eac44183b76242bf
parent90c971625e6560cf6a5633cd269cc7286028f021 (diff)
parent587f338daabfd7ee5f02bff8fc976a0d32e13c2b (diff)
downloadbrew-120985e23fb4a2bbf4233fe437644fc16402a163.tar.bz2
Merge pull request #2684 from mistydemeo/add_vendored_sha256
Add vendored sha256
-rw-r--r--Library/Homebrew/cmd/vendor-install.sh9
-rw-r--r--Library/Homebrew/extend/pathname.rb2
2 files changed, 10 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/vendor-install.sh b/Library/Homebrew/cmd/vendor-install.sh
index 46f0c72f9..fe7e26dd4 100644
--- a/Library/Homebrew/cmd/vendor-install.sh
+++ b/Library/Homebrew/cmd/vendor-install.sh
@@ -82,6 +82,15 @@ fetch() {
elif [[ -x "$(which sha256sum)" ]]
then
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
odie "Cannot verify the checksum ('shasum' or 'sha256sum' not found)!"
fi
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index c413e9e94..93b1c720b 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -322,7 +322,7 @@ class Pathname
def sha256
require "digest/sha2"
- incremental_hash(Digest::SHA2)
+ incremental_hash(Digest::SHA256)
end
def verify_checksum(expected)