Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

audit: warn about nonexistent options passed to deps

  • Loading branch information...
commit 58080645a9264d1a0b10fae23123792ed99775df 1 parent e7f3602
@jacknagel authored
Showing with 12 additions and 6 deletions.
  1. +12 −6 Library/Homebrew/cmd/audit.rb
View
18 Library/Homebrew/cmd/audit.rb
@@ -129,18 +129,24 @@ def audit_deps
# 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'"
Please sign in to comment.
Something went wrong with that request. Please try again.