summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-19 01:37:28 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-09-19 01:37:28 +0000
commit524ad518b67a20445980de24b85b7d8b4d4fc2e9 (patch)
treea92f04d7a049c8b0d87d82d7d358465a387b2220
parent610c69076925a9a673fc238433d88a06aa908ac0 (diff)
* lib/fileutils.rb (cp_r): default is :dereference_root=>true for backward compatibility. [ruby-dev:27145]
* test/fileutils/test_fileutils.rb (test_cp_r): test it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--lib/fileutils.rb1
-rw-r--r--test/fileutils/test_fileutils.rb5
3 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9623be8..c3a6cd2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Mon Sep 19 10:36:06 2005 Minero Aoki <aamine@loveruby.net>
+
+ * lib/fileutils.rb (cp_r): default is :dereference_root=>true for
+ backward compatibility. [ruby-dev:27145]
+
+ * test/fileutils/test_fileutils.rb (test_cp_r): test it.
+
Mon Sep 19 09:57:39 2005 Minero Aoki <aamine@loveruby.net>
* test/fileutils/test_fileutils.rb: backported from trunk (1.36).
diff --git a/lib/fileutils.rb b/lib/fileutils.rb
index 3465104..8bfaf8b 100644
--- a/lib/fileutils.rb
+++ b/lib/fileutils.rb
@@ -418,6 +418,7 @@ module FileUtils
fu_check_options options, :preserve, :noop, :verbose, :dereference_root
fu_output_message "cp -r#{options[:preserve] ? 'p' : ''} #{[src,dest].flatten.join ' '}" if options[:verbose]
return if options[:noop]
+ options[:dereference_root] = true unless options.key?(:dereference_root)
fu_each_src_dest(src, dest) do |s, d|
copy_entry s, d, options[:preserve], options[:dereference_root]
end
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb
index 2cce67c..cab51c9 100644
--- a/test/fileutils/test_fileutils.rb
+++ b/test/fileutils/test_fileutils.rb
@@ -296,7 +296,10 @@ if have_symlink?
cp_r 'tmp/cpr_src2', 'tmp/cpr_dest2'
assert_directory 'tmp/cpr_dest2'
#assert_not_symlink 'tmp/cpr_dest2'
- assert_symlink 'tmp/cpr_dest2' # 2005-05-26: feature change
+ # * 2005-05-26: feature change on trunk
+ #assert_symlink 'tmp/cpr_dest2'
+ # * 2005-09-19: revert for 1.8 (:dereference_root => true by default)
+ assert_not_symlink 'tmp/cpr_dest2'
assert_symlink 'tmp/cpr_dest2/symlink'
assert_equal 'SLdest', File.readlink('tmp/cpr_dest2/symlink')
end