diff options
| author | Jack Nagel | 2012-08-07 14:22:20 -0500 |
|---|---|---|
| committer | Jack Nagel | 2012-08-07 14:24:54 -0500 |
| commit | 0f19fc498714918ecd4b23cc0f22a20a16fff4b1 (patch) | |
| tree | ef053c54ae8590e31027c17115b0eed329af9409 | |
| parent | 3b1a78d84b681d60dab8656862451ae46a68b4fa (diff) | |
| download | homebrew-0f19fc498714918ecd4b23cc0f22a20a16fff4b1.tar.bz2 | |
Simplify printing conflicts in `brew info`
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
| -rw-r--r-- | Library/Homebrew/cmd/info.rb | 5 | ||||
| -rw-r--r-- | Library/Homebrew/formula.rb | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index c263d3929..265abbec9 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -68,10 +68,7 @@ module Homebrew extend self end puts "Depends on: #{f.deps*', '}" unless f.deps.empty? - conflicts = [] - f.requirements.each do |dep| - conflicts << dep.formula if dep.is_a? ConflictRequirement - end + conflicts = f.conflicts.map { |c| c.formula } puts "Conflicts with: #{conflicts*', '}" unless conflicts.empty? if f.rack.directory? diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index fb0855a17..d78ded9b0 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -425,6 +425,10 @@ class Formula def deps; self.class.dependencies.deps; end def requirements; self.class.dependencies.requirements; end + def conflicts + requirements.select { |r| r.is_a? ConflictRequirement } + end + # deps are in an installable order # which means if a depends on b then b will be ordered before a in this list def recursive_deps |
