aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend/pathname.rb
diff options
context:
space:
mode:
authorMike McQuaid2013-10-06 22:04:46 +0100
committerMike McQuaid2013-10-10 16:46:47 +0100
commitcaa2f87728b67118f25933054d05b8428a553622 (patch)
treea3acba997ac467e1603bc1a7706b0e913aba69d2 /Library/Homebrew/extend/pathname.rb
parent05a2261877c09a381fdae52e28dee853d4aa0930 (diff)
downloadbrew-caa2f87728b67118f25933054d05b8428a553622.tar.bz2
InstallRenamed: don't overwrite etc files; rename.
If an etc file exists on installation instead of overwriting it (or requiring all the manual checks in formula) simply copy it with the extension `.default` appended.
Diffstat (limited to 'Library/Homebrew/extend/pathname.rb')
-rw-r--r--Library/Homebrew/extend/pathname.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 0edd1bd06..fd5cf67f1 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -50,6 +50,8 @@ class Pathname
# and also broken symlinks are not the end of the world
raise "#{src} does not exist" unless File.symlink? src or File.exist? src
+ dst = yield(src, dst) if block_given?
+
mkpath
if File.symlink? src
# we use the BSD mv command because FileUtils copies the target and