Fix install_name massaging for keg-only brews

Fixes Homebrew/homebrew#6065.

My pre-emptive fix that avoided calling Pathname.ensure_writable because I was not convinced it worked broke this function due to incorrect logic.

The lesson is, don’t write pre-emptive fixes. Wait until you've seen the bug first. All code has bugs in, so write less. I'm an idiot sometimes.
This commit is contained in:
Max Howell 2011-06-28 17:28:37 +01:00
parent 02b09e311f
commit 870f36769e

View File

@ -2,9 +2,6 @@ class Keg
def fix_install_names
dylibs.each do |dylib|
bad_install_names_for dylib do |id, bad_names|
# avoid the chmod change if unecessary—I'm not convinced it reverses right
next if bad_names.empty? and id.to_s == dylib.to_s
dylib.ensure_writable do
system "install_name_tool", "-id", id, dylib
bad_names.each do |bad_name|