diff options
| author | Xu Cheng | 2016-03-20 14:03:28 +0800 |
|---|---|---|
| committer | Xu Cheng | 2016-03-20 14:55:58 +0800 |
| commit | bd7e8543b3fba04a914f8f8c583652d6970d51db (patch) | |
| tree | 093840f1a433792f3231f32b9f6d6bf9d428b11a /Library/Homebrew/compat | |
| parent | 93cbab0021676010f195c8629d79fefdb00a2d40 (diff) | |
| download | brew-bd7e8543b3fba04a914f8f8c583652d6970d51db.tar.bz2 | |
deprecate SHA1
Diffstat (limited to 'Library/Homebrew/compat')
| -rw-r--r-- | Library/Homebrew/compat/sha1.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Library/Homebrew/compat/sha1.rb b/Library/Homebrew/compat/sha1.rb new file mode 100644 index 000000000..9d6fbc6e0 --- /dev/null +++ b/Library/Homebrew/compat/sha1.rb @@ -0,0 +1,35 @@ +class Formula + def self.sha1(val) + stable.sha1(val) + end +end + +class SoftwareSpec + def sha1(val) + @resource.sha1(val) + end +end + +class Resource + def sha1(val) + @checksum = Checksum.new(:sha1, val) + end +end + +class BottleSpecification + def sha1(val) + digest, tag = val.shift + collector[tag] = Checksum.new(:sha1, digest) + end +end + +class Pathname + def sha1 + require "digest/sha1" + opoo <<-EOS.undent + SHA1 support is deprecated and will be removed in a future version. + Please switch this formula to SHA256. + EOS + incremental_hash(Digest::SHA1) + end +end |
