Allow brewing without an MD5 hash

You can either have none, in which case a warning is displayed, or
you can have one, but it *must* match.
This commit is contained in:
Adam Vandenberg 2009-07-30 11:57:24 -07:00 committed by Max Howell
parent 0dd07b3fdc
commit ec65bb4819

View File

@ -129,7 +129,11 @@ class AbstractFormula
tgz=Pathname.new(fetch()).realpath
begin
md5=`md5 -q "#{tgz}"`.strip
raise "MD5 mismatch: #{md5}" unless @md5 and md5 == @md5.downcase
if @md5 and not @md5.empty?
raise "MD5 mismatch: #{md5}" unless md5 == @md5.downcase
else
ohai "Warning: Formula does not provide an MD5 hash."
end
# we make an additional subdirectory so know exactly what we are
# recursively deleting later