diff options
| author | Adam Vandenberg | 2010-09-17 17:11:27 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2010-09-17 17:11:27 -0700 |
| commit | b34bd5041c6525afe9d1b6b5f44c3c6f3a66bfdf (patch) | |
| tree | fdd08cedde18c4b1e3b6c0b9279edf34f23834e4 /Library | |
| parent | a4a1ff875a61f9562c015d545f5c1d49c192a9be (diff) | |
| download | homebrew-b34bd5041c6525afe9d1b6b5f44c3c6f3a66bfdf.tar.bz2 | |
brew-fetch - warn if checksums differ
Diffstat (limited to 'Library')
| -rwxr-xr-x | Library/Contributions/examples/brew-fetch.rb | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Library/Contributions/examples/brew-fetch.rb b/Library/Contributions/examples/brew-fetch.rb index 2f7ddc6f8..28606e3fd 100755 --- a/Library/Contributions/examples/brew-fetch.rb +++ b/Library/Contributions/examples/brew-fetch.rb @@ -10,8 +10,19 @@ ARGV.formulae.each do |f| end the_tarball = f.downloader.fetch - if the_tarball.kind_of? Pathname - puts "MD5: #{the_tarball.md5}" - puts "SHA1: #{the_tarball.sha1}" + next unless the_tarball.kind_of? Pathname + + previous_md5 = f.instance_variable_get(:@md5) + previous_sha1 = f.instance_variable_get(:@sha1) + + puts "MD5: #{the_tarball.md5}" + puts "SHA1: #{the_tarball.sha1}" + puts + + unless previous_md5.nil? or the_tarball.md5 == previous_md5 + opoo "Formula reports different MD5: #{previous_md5}" + end + unless previous_sha1.nil? or the_tarball.sha1 == previous_sha1 + opoo "Formula reports different SHA1: #{previous_sha1}" end end |
