aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-01-23 00:26:31 -0600
committerJack Nagel2013-01-26 12:14:51 -0600
commit2534c1d45e4410221a948591fe3ad985558d320d (patch)
tree396e508c0f22682dd369d8cf960e1b7617b3540b /Library
parent5ac4e4f0714ffb364ac528d1a9b6697ae1693bf6 (diff)
downloadbrew-2534c1d45e4410221a948591fe3ad985558d320d.tar.bz2
audit: warn about nonexistent options passed to deps
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/audit.rb18
1 files changed, 12 insertions, 6 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index bb0e0f00b..8d4ddcc68 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -129,18 +129,24 @@ class FormulaAuditor
# Check for things we don't like to depend on.
# We allow non-Homebrew installs whenever possible.
- f.deps.each do |d|
+ f.deps.each do |dep|
begin
- dep_f = Formula.factory d
+ dep_f = dep.to_formula
rescue
- problem "Can't find dependency \"#{d}\"."
+ problem "Can't find dependency #{dep.inspect}."
end
- case d.name
+ dep.options.reject do |opt|
+ dep_f.build.has_option?(opt.name)
+ end.each do |opt|
+ problem "Dependency #{dep} does not define option #{opt.name.inspect}"
+ end
+
+ case dep.name
when "git", "python", "ruby", "emacs", "mysql", "postgresql", "mercurial"
problem <<-EOS.undent
- Don't use #{d} as a dependency. We allow non-Homebrew
- #{d} installations.
+ Don't use #{dep} as a dependency. We allow non-Homebrew
+ #{dep} installations.
EOS
when 'gfortran'
problem "Use ENV.fortran during install instead of depends_on 'gfortran'"