mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
download_strategy: cvs source_modified_time (#268)
This commit is contained in:
parent
8ecfab8a59
commit
5703ebf496
@ -713,6 +713,21 @@ class CVSDownloadStrategy < VCSDownloadStrategy
|
|||||||
end
|
end
|
||||||
end
|
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)
|
||||||
|
cached_location.find do |f|
|
||||||
|
Find.prune if f.directory? && f.basename.to_s == "CVS"
|
||||||
|
next unless f.file?
|
||||||
|
mtime = f.mtime
|
||||||
|
max_mtime = mtime if mtime > max_mtime
|
||||||
|
end
|
||||||
|
max_mtime
|
||||||
|
end
|
||||||
|
|
||||||
def stage
|
def stage
|
||||||
cp_r File.join(cached_location, "."), Dir.pwd
|
cp_r File.join(cached_location, "."), Dir.pwd
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user