From 0e5436d4abb120fbe101533f300d97e5688e7cd3 Mon Sep 17 00:00:00 2001 From: Charlie Sharpsteen Date: Thu, 10 Mar 2011 12:26:29 -0800 Subject: [PATCH] brew audit - check for depends_on 'gfortran' Signed-off-by: Adam Vandenberg --- Library/Homebrew/cmd/audit.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index 049260d47e..354858b071 100755 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -6,7 +6,7 @@ def ff return ARGV.formulae end -def audit_formula_text text +def audit_formula_text name, text problems = [] # Commented-out cmake support from default template @@ -98,6 +98,11 @@ def audit_formula_text text end end + # Formula depends_on gfortran + if text =~ /\s*depends_on\s*(\'|\")gfortran(\'|\")\s*$/ + problems << " * Use ENV.fortran during install instead of depends_on 'gfortran'" + end unless name == "gfortran" # Gfortran itself has this text in the caveats + return problems end @@ -230,7 +235,7 @@ module Homebrew extend self # Don't try remaining audits on text in __END__ text_without_patch = (text.split("__END__")[0]).strip() - problems += audit_formula_text(text_without_patch) + problems += audit_formula_text(f.name, text_without_patch) problems += audit_formula_options(f, text_without_patch) unless problems.empty?