fetch: use new checksum verification
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
parent
b2ff74372e
commit
af53f54b24
@ -36,14 +36,10 @@ module Homebrew extend self
|
|||||||
puts "SHA1: #{the_tarball.sha1}"
|
puts "SHA1: #{the_tarball.sha1}"
|
||||||
puts "SHA256: #{the_tarball.sha2}"
|
puts "SHA256: #{the_tarball.sha2}"
|
||||||
|
|
||||||
unless previous_md5.nil? or previous_md5.empty? or the_tarball.md5 == previous_md5
|
begin
|
||||||
opoo "Formula reports different MD5: #{previous_md5}"
|
f.verify_download_integrity the_tarball
|
||||||
end
|
rescue ChecksumMismatchError => e
|
||||||
unless previous_sha1.nil? or previous_sha1.empty? or the_tarball.sha1 == previous_sha1
|
opoo "Formula reports different #{e.hash_type}: #{e.expected}"
|
||||||
opoo "Formula reports different SHA1: #{previous_sha1}"
|
|
||||||
end
|
|
||||||
unless previous_sha2.nil? or previous_sha2.empty? or the_tarball.sha2 == previous_sha2
|
|
||||||
opoo "Formula reports different SHA256: #{previous_sha2}"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -158,15 +158,17 @@ class ChecksumMismatchError < RuntimeError
|
|||||||
attr :advice, true
|
attr :advice, true
|
||||||
attr :expected
|
attr :expected
|
||||||
attr :actual
|
attr :actual
|
||||||
|
attr :hash_type
|
||||||
|
|
||||||
def initialize expected, actual
|
def initialize expected, actual
|
||||||
@expected = expected
|
@expected = expected
|
||||||
@actual = actual
|
@actual = actual
|
||||||
|
@hash_type = expected.hash_type.to_s.upcase
|
||||||
|
|
||||||
super <<-EOS.undent
|
super <<-EOS.undent
|
||||||
#{expected.hash_type.to_s.upcase} mismatch
|
#{@hash_type} mismatch
|
||||||
Expected: #{expected}
|
Expected: #{@expected}
|
||||||
Actual: #{actual}
|
Actual: #{@actual}
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user