Skip to content

Commit

Permalink
os/mac/ruby_keg: improve error reporting
Browse files Browse the repository at this point in the history
A failure to change a dylib ID or install name would previously cause a
rather cryptic error message, that didn't include the name of the file
that caused the failure, unless `--debug` was specified. Make sure to
output this information in all cases before re-raising the exception.
  • Loading branch information
UniqMartin committed Aug 10, 2016
1 parent 0c6e307 commit 06fe347
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Library/Homebrew/os/mac/ruby_keg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,26 @@ def change_dylib_id(id, file)
@require_install_name_tool = true
puts "Changing dylib ID of #{file}\n from #{file.dylib_id}\n to #{id}" if ARGV.debug?
MachO::Tools.change_dylib_id(file, id)
rescue MachO::MachOError
onoe <<-EOS.undent
Failed changing dylib ID of #{file}
from #{file.dylib_id}
to #{id}
EOS
raise
end

def change_install_name(old, new, file)
@require_install_name_tool = true
puts "Changing install name in #{file}\n from #{old}\n to #{new}" if ARGV.debug?
MachO::Tools.change_install_name(file, old, new)
rescue MachO::MachOError
onoe <<-EOS.undent
Failed changing install name in #{file}
from #{old}
to #{new}
EOS
raise
end

def require_install_name_tool?
Expand Down

0 comments on commit 06fe347

Please sign in to comment.