Skip to content
Snippets Groups Projects
Commit aeaf9af7 authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

Merge pull request #2470 from johnhawkinson/conflicts-info

Display formula conflict reasons
parents ea8be174 8e2198ff
No related branches found
Tags 1.2.1
No related merge requests found
......@@ -123,8 +123,16 @@ module Homebrew
puts f.desc if f.desc
puts Formatter.url(f.homepage) if f.homepage
conflicts = f.conflicts.map(&:name).sort!
puts "Conflicts with: #{conflicts*", "}" unless conflicts.empty?
conflicts = f.conflicts.map do |c|
reason = " (because #{c.reason})" if c.reason
"#{c.name}#{reason}"
end.sort!
unless conflicts.empty?
puts <<-EOS.undent
Conflicts with:
#{conflicts.join(" \n")}
EOS
end
kegs = f.installed_kegs.sort_by(&:version)
if kegs.empty?
......
......@@ -2366,7 +2366,7 @@ class Formula
end
# If this formula conflicts with another one.
# <pre>conflicts_with "imagemagick", :because => "because this is just a stupid example"</pre>
# <pre>conflicts_with "imagemagick", :because => "because both install 'convert' binaries"</pre>
def conflicts_with(*names)
opts = names.last.is_a?(Hash) ? names.pop : {}
names.each { |name| conflicts << FormulaConflict.new(name, opts[:because]) }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment