summaryrefslogtreecommitdiff
path: root/lib/fileutils.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-20 07:03:11 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-20 07:03:11 +0000
commit0242f7ccae800eab5c3ab5f3129b1126ffbb45c3 (patch)
treeeac77c0e9180659eb96f11e3eeba9b0a99e5fe49 /lib/fileutils.rb
parent418771316cc54e9507287c563698519fb683c612 (diff)
Overwrite destination symlink file if `remove_destination` is set.
[Bug #13914][ruby-core:82846] Patch by @mzp https://github.com/ruby/fileutils/pull/9 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/fileutils.rb')
-rw-r--r--lib/fileutils.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/fileutils.rb b/lib/fileutils.rb
index 37945b4096..adff31c944 100644
--- a/lib/fileutils.rb
+++ b/lib/fileutils.rb
@@ -412,7 +412,7 @@ module FileUtils
def copy_entry(src, dest, preserve = false, dereference_root = false, remove_destination = false)
Entry_.new(src, nil, dereference_root).wrap_traverse(proc do |ent|
destent = Entry_.new(dest, ent.rel, false)
- File.unlink destent.path if remove_destination && File.file?(destent.path)
+ File.unlink destent.path if remove_destination && (File.file?(destent.path) || File.symlink?(destent.path))
ent.copy destent.path
end, proc do |ent|
destent = Entry_.new(dest, ent.rel, false)