Fix brew-audit Fortran check

The Fortran regex only allowed for trailing whitespace after:

    depends_on 'gfortran'

This missed conditional dependencies, such as:

    depends_on 'gfortran' if something?

Such a dependency was present in the NetCDF formula.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
Charlie Sharpsteen 2011-04-01 12:30:02 -07:00 committed by Adam Vandenberg
parent 78ace67b3f
commit 7776f7ee11

View File

@ -107,7 +107,7 @@ def audit_formula_text name, text
end if strict? end if strict?
# Formula depends_on gfortran # Formula depends_on gfortran
if text =~ /\s*depends_on\s*(\'|\")gfortran(\'|\")\s*$/ if text =~ /^\s*depends_on\s*(\'|\")gfortran(\'|\").*/
problems << " * Use ENV.fortran during install instead of depends_on 'gfortran'" problems << " * Use ENV.fortran during install instead of depends_on 'gfortran'"
end unless name == "gfortran" # Gfortran itself has this text in the caveats end unless name == "gfortran" # Gfortran itself has this text in the caveats