diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 41853554e6..61d7608cb1 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -556,16 +556,23 @@ class FormulaInstaller begin keg.link - rescue Keg::LinkError => e + rescue Keg::ConflictError => e onoe "The `brew link` step did not complete successfully" puts "The formula built, but is not symlinked into #{HOMEBREW_PREFIX}" - puts "You can try again using:" - puts " brew link #{f.name}" + puts e puts puts "Possible conflicting files are:" mode = OpenStruct.new(:dry_run => true, :overwrite => true) keg.link(mode) @show_summary_heading = true + rescue Keg::LinkError => e + onoe "The `brew link` step did not complete successfully" + puts "The formula built, but is not symlinked into #{HOMEBREW_PREFIX}" + puts e + puts + puts "You can try again using:" + puts " brew link #{f.name}" + @show_summary_heading = true rescue Exception => e onoe "An unexpected error occurred during the `brew link` step" puts "The formula built, but is not symlinked into #{HOMEBREW_PREFIX}"