aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/keg_fix_install_names.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/Library/Homebrew/keg_fix_install_names.rb b/Library/Homebrew/keg_fix_install_names.rb
index 083afabff..efc1bd48c 100644
--- a/Library/Homebrew/keg_fix_install_names.rb
+++ b/Library/Homebrew/keg_fix_install_names.rb
@@ -45,10 +45,15 @@ class Keg < Pathname
changed = s.gsub!(old_cellar, new_cellar)
changed = s.gsub!(old_prefix, new_prefix) || changed
- if changed
+ begin
first.atomic_write(s)
+ rescue Errno::EACCES
+ first.ensure_writable do
+ first.open("wb") { |f| f.write(s) }
+ end
+ else
rest.each { |file| FileUtils.ln(first, file, :force => true) }
- end
+ end if changed
end
end