brew-fetch - warn if checksums differ

This commit is contained in:
Adam Vandenberg 2010-09-17 17:11:27 -07:00
parent b60a1b1ebe
commit 389fdec9d4

View File

@ -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