diff options
| author | Jack Nagel | 2014-10-17 00:11:46 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-10-17 00:11:46 -0500 |
| commit | fb30041640852f14771ac928f655fb3d17a33926 (patch) | |
| tree | b645d21c0042c7a6406a9c9267ae469778d8d204 /Library | |
| parent | 73d08fcc1aa37059db2c0b4810fc8db8719df970 (diff) | |
| download | brew-fb30041640852f14771ac928f655fb3d17a33926.tar.bz2 | |
audit: loop over deps once
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/audit.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index 88b3a819c..a0359ae07 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -114,16 +114,10 @@ class FormulaAuditor end end - def audit_deps - # Don't depend_on aliases; use full name - @@aliases ||= Formula.aliases + @@aliases ||= Formula.aliases + def audit_deps @specs.each do |spec| - spec.deps.select { |d| @@aliases.include? d.name }.each do |d| - real_name = d.to_formula.name - problem "Dependency '#{d}' is an alias; use the canonical name '#{real_name}'." - end - # Check for things we don't like to depend on. # We allow non-Homebrew installs whenever possible. spec.deps.each do |dep| @@ -137,6 +131,10 @@ class FormulaAuditor next end + if @@aliases.include?(dep.name) + problem "Dependency '#{dep.name}' is an alias; use the canonical name '#{dep.to_formula.name}'." + end + dep.options.reject do |opt| next true if dep_f.option_defined?(opt) dep_f.requirements.detect do |r| |
