aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend
diff options
context:
space:
mode:
authorMike McQuaid2013-10-06 22:04:46 +0100
committerMike McQuaid2013-10-10 16:46:47 +0100
commit8db4a6c18d3f69a1aa41b9db17b63ae751ef1ff8 (patch)
tree2523a2b1a98554651f7e145ac3c4e1202eed4e62 /Library/Homebrew/extend
parente39703be8ee4df3f55a9e583cd62439297063eed (diff)
downloadhomebrew-8db4a6c18d3f69a1aa41b9db17b63ae751ef1ff8.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')
-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