DownloadStrategy: preserve timestamp for cp

This commit is contained in:
Xu Cheng 2016-05-26 20:01:04 +08:00
parent 41325bcfa0
commit 8b61d7899b

View File

@ -218,7 +218,7 @@ class AbstractFileDownloadStrategy < AbstractDownloadStrategy
when :p7zip when :p7zip
safe_system "7zr", "x", cached_location safe_system "7zr", "x", cached_location
else else
cp cached_location, basename_without_params cp cached_location, basename_without_params, :preserve => true
end end
end end
@ -416,7 +416,7 @@ end
# Useful for installing jars. # Useful for installing jars.
class NoUnzipCurlDownloadStrategy < CurlDownloadStrategy class NoUnzipCurlDownloadStrategy < CurlDownloadStrategy
def stage def stage
cp cached_location, basename_without_params cp cached_location, basename_without_params, :preserve => true
end end
end end
@ -573,7 +573,7 @@ class GitDownloadStrategy < VCSDownloadStrategy
def stage def stage
super super
cp_r File.join(cached_location, "."), Dir.pwd cp_r File.join(cached_location, "."), Dir.pwd, :preserve => true
end end
def source_modified_time def source_modified_time
@ -714,8 +714,6 @@ class CVSDownloadStrategy < VCSDownloadStrategy
end end
def source_modified_time 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 # Filter CVS's files because the timestamp for each of them is the moment
# of clone. # of clone.
max_mtime = Time.at(0) max_mtime = Time.at(0)
@ -729,7 +727,7 @@ class CVSDownloadStrategy < VCSDownloadStrategy
end end
def stage def stage
cp_r File.join(cached_location, "."), Dir.pwd cp_r File.join(cached_location, "."), Dir.pwd, :preserve => true
end end
private private
@ -814,7 +812,7 @@ class BazaarDownloadStrategy < VCSDownloadStrategy
def stage def stage
# The export command doesn't work on checkouts # The export command doesn't work on checkouts
# See https://bugs.launchpad.net/bzr/+bug/897511 # 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" rm_r ".bzr"
end end