aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorJack Nagel2014-10-17 00:11:46 -0500
committerJack Nagel2014-10-17 00:11:46 -0500
commit7d681c763eba133716ebfdcc1f6570933c8d04cb (patch)
tree35483762e7b6c511cce75c591b64226ccc08eeae /Library/Homebrew/cmd
parent501978663642181f95a12c3326aa24ea8b1bbab1 (diff)
downloadhomebrew-7d681c763eba133716ebfdcc1f6570933c8d04cb.tar.bz2
audit: loop over deps once
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/audit.rb14
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|