From ec65bb48190aca260280ef4ce90225af3e4d2d13 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Thu, 30 Jul 2009 11:57:24 -0700 Subject: [PATCH] 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. --- Library/Homebrew/formula.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 5c082e4902..ad975ef007 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -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