diff --git a/Library/Contributions/examples/brew-fetch.rb b/Library/Contributions/examples/brew-fetch.rb index 2f7ddc6f80..28606e3fd0 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