summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-05 09:09:35 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-05 09:09:35 +0000
commit21aa7990efeedec6050936c63bfeb77664a06267 (patch)
treed680e7e4d5946ac27e6a2fa8f7dd5a9cf10ba516
parenta5478a01c35564cacd8a17f63bcedba5560f27a0 (diff)
downloadruby-21aa7990efeedec6050936c63bfeb77664a06267.tar.gz
ruby-21aa7990efeedec6050936c63bfeb77664a06267.tar.xz
ruby-21aa7990efeedec6050936c63bfeb77664a06267.zip
* lib/fileutils.rb (install): should preserve timestamp only.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--lib/fileutils.rb10
2 files changed, 9 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index e86337b2b..e632ba521 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Aug 5 17:58:57 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * lib/fileutils.rb (install): should preserve timestamp only.
+
Tue Aug 5 15:47:34 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval.c (rb_load): should preserve current source file/line.
diff --git a/lib/fileutils.rb b/lib/fileutils.rb
index d6714229a..dfec5f900 100644
--- a/lib/fileutils.rb
+++ b/lib/fileutils.rb
@@ -639,10 +639,10 @@ module FileUtils
fu_each_src_dest(src, dest) do |s,d|
unless FileTest.exist?(d) and compare_file(s,d)
- fu_preserve_attr(options[:preserve], s, d) {
- remove_file d, true
- copy_file s, d
- }
+ remove_file d, true
+ st = File.stat(s) if options[:preserve]
+ copy_file s, d
+ File.utime st.atime, st.mtime, d if options[:preserve]
File.chmod options[:mode], d if options[:mode]
end
end
@@ -769,7 +769,7 @@ module FileUtils
'copy' => %w( preserve noop verbose ),
'cp' => %w( preserve noop verbose ),
'cp_r' => %w( preserve noop verbose ),
- 'install' => %w( mode noop verbose ),
+ 'install' => %w( preserve mode noop verbose ),
'link' => %w( force noop verbose ),
'ln' => %w( force noop verbose ),
'ln_s' => %w( force noop verbose ),