diff options
| author | Mike McQuaid | 2014-02-16 22:35:14 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2014-02-16 22:35:14 +0000 |
| commit | 34930586c342dcf10e36ab3eb0c5388dff708e5f (patch) | |
| tree | 43aee6390c54f7958e5aca97fbda939246ec8af0 /Library/Homebrew/cmd | |
| parent | 8157515b2aa7de4a8a79568becb9d050e7fa2c45 (diff) | |
| download | brew-34930586c342dcf10e36ab3eb0c5388dff708e5f.tar.bz2 | |
audit: handle recommended/optional options better.
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/audit.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index 48f1d6620..4c44de2c1 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -143,8 +143,14 @@ class FormulaAuditor end dep.options.reject do |opt| - # TODO -- fix for :recommended, should still allow --with-xyz - dep_f.build.has_option?(opt.name) + next true if dep_f.build.has_option?(opt.name) + dep_f.requirements.detect do |r| + if r.tags.include? :recommended + opt.name == "with-#{r.name}" + elsif r.tags.include? :optional + opt.name == "without-#{r.name}" + end + end end.each do |opt| problem "Dependency #{dep} does not define option #{opt.name.inspect}" end |
