Give more detailed information about link errors at install-time

This commit is contained in:
Jack Nagel 2014-06-27 16:10:42 -05:00
parent 35267d7c22
commit 2de2d64907

View File

@ -556,16 +556,23 @@ class FormulaInstaller
begin begin
keg.link keg.link
rescue Keg::LinkError => e rescue Keg::ConflictError => e
onoe "The `brew link` step did not complete successfully" onoe "The `brew link` step did not complete successfully"
puts "The formula built, but is not symlinked into #{HOMEBREW_PREFIX}" puts "The formula built, but is not symlinked into #{HOMEBREW_PREFIX}"
puts "You can try again using:" puts e
puts " brew link #{f.name}"
puts puts
puts "Possible conflicting files are:" puts "Possible conflicting files are:"
mode = OpenStruct.new(:dry_run => true, :overwrite => true) mode = OpenStruct.new(:dry_run => true, :overwrite => true)
keg.link(mode) keg.link(mode)
@show_summary_heading = true @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 rescue Exception => e
onoe "An unexpected error occurred during the `brew link` step" onoe "An unexpected error occurred during the `brew link` step"
puts "The formula built, but is not symlinked into #{HOMEBREW_PREFIX}" puts "The formula built, but is not symlinked into #{HOMEBREW_PREFIX}"