Add audit for xcodebuild.

xcodebuild should be passed an explicit SYMROOT, since the user
can override this.

Also added --strict, so certain audits can be ignored in most
cases (including this one.)
This commit is contained in:
Adam Vandenberg 2011-03-21 12:54:00 -07:00
parent 8556961034
commit ace8723caf

View File

@ -1,6 +1,12 @@
require 'formula'
require 'utils'
# Use "brew audit --strict" to enable even stricter checks.
def strict?
ARGV.flag? "--strict"
end
def ff
return Formula.all if ARGV.named.empty?
return ARGV.formulae
@ -103,6 +109,11 @@ def audit_formula_text name, text
problems << " * Use ENV.fortran during install instead of depends_on 'gfortran'"
end unless name == "gfortran" # Gfortran itself has this text in the caveats
# xcodebuild should specify SYMROOT
if text =~ /xcodebuild/ and not text =~ /SYMROOT=/
problems << " * xcodebuild should be passed an explicit \"SYMROOT\""
end if strict?
return problems
end
@ -182,7 +193,7 @@ def audit_formula_urls f
unless p =~ %r[^http://mirrors\.kernel\.org/debian/pool/]
problems << " * \"mirrors.kernel.org\" is the preferred mirror for debian software."
end
end if strict?
end
return problems