Adjust installer for updated link error handling
This commit is contained in:
parent
72d83adaf3
commit
4b4fc003df
@ -561,18 +561,24 @@ class FormulaInstaller
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
keg.link
|
keg.link
|
||||||
rescue Exception => e
|
rescue Keg::LinkError => 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 `brew link #{f.name}'"
|
puts "You can try again using:"
|
||||||
|
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)
|
||||||
ohai e, e.backtrace if debug?
|
@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}"
|
||||||
|
puts e
|
||||||
|
puts e.backtrace if debug?
|
||||||
@show_summary_heading = true
|
@show_summary_heading = true
|
||||||
ignore_interrupts { keg.unlink }
|
ignore_interrupts { keg.unlink }
|
||||||
raise unless e.kind_of? RuntimeError
|
raise
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user