aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2016-05-26 20:01:04 +0800
committerXu Cheng2016-05-26 22:13:50 +0800
commit8b61d7899b6798f70509a8d3b2052ddcae0d903f (patch)
tree19fbcaac1ffa302f675eeed63835b5d779ab91c5 /Library
parent41325bcfa0355a5a11d75a715f349635c459ed5d (diff)
downloadbrew-8b61d7899b6798f70509a8d3b2052ddcae0d903f.tar.bz2
DownloadStrategy: preserve timestamp for cp
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/download_strategy.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 1ac1dbcb4..ba58f2db8 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -218,7 +218,7 @@ class AbstractFileDownloadStrategy < AbstractDownloadStrategy
when :p7zip
safe_system "7zr", "x", cached_location
else
- cp cached_location, basename_without_params
+ cp cached_location, basename_without_params, :preserve => true
end
end
@@ -416,7 +416,7 @@ end
# Useful for installing jars.
class NoUnzipCurlDownloadStrategy < CurlDownloadStrategy
def stage
- cp cached_location, basename_without_params
+ cp cached_location, basename_without_params, :preserve => true
end
end
@@ -573,7 +573,7 @@ class GitDownloadStrategy < VCSDownloadStrategy
def stage
super
- cp_r File.join(cached_location, "."), Dir.pwd
+ cp_r File.join(cached_location, "."), Dir.pwd, :preserve => true
end
def source_modified_time
@@ -714,8 +714,6 @@ class CVSDownloadStrategy < VCSDownloadStrategy
end
def source_modified_time
- # Look for the file timestamps under {#cached_location} because
- # newly-unpacked directory can have timestamps of the moment of copying.
# Filter CVS's files because the timestamp for each of them is the moment
# of clone.
max_mtime = Time.at(0)
@@ -729,7 +727,7 @@ class CVSDownloadStrategy < VCSDownloadStrategy
end
def stage
- cp_r File.join(cached_location, "."), Dir.pwd
+ cp_r File.join(cached_location, "."), Dir.pwd, :preserve => true
end
private
@@ -814,7 +812,7 @@ class BazaarDownloadStrategy < VCSDownloadStrategy
def stage
# The export command doesn't work on checkouts
# See https://bugs.launchpad.net/bzr/+bug/897511
- cp_r File.join(cached_location, "."), Dir.pwd
+ cp_r File.join(cached_location, "."), Dir.pwd, :preserve => true
rm_r ".bzr"
end