diff options
| author | Adam Vandenberg | 2010-09-17 17:11:27 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2010-09-17 17:11:27 -0700 |
| commit | 389fdec9d4889401a32b2ff6015902cad308ff71 (patch) | |
| tree | d4fba8e88ba8c2981ed9a29a5981dd27bd327596 /Library | |
| parent | b60a1b1ebe97adb5c3262eeba942d7abf23a3693 (diff) | |
| download | brew-389fdec9d4889401a32b2ff6015902cad308ff71.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 |
