aboutsummaryrefslogtreecommitdiffstats
path: root/tool/make-snapshot
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-09-02 12:15:35 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-09-02 12:16:21 +0900
commit1f636e74e661e8976d8884a1dcb7027a97cb6a83 (patch)
treed37bed4c6b1a46a991bad4f436b7ca8f286def19 /tool/make-snapshot
parent63ab7046a1a5c374a52dfa79406fe52d92d80344 (diff)
downloadruby-1f636e74e661e8976d8884a1dcb7027a97cb6a83.tar.gz
Set mtime of checked out files to past time
instead of waiting 2 seconds, if possible.
Diffstat (limited to 'tool/make-snapshot')
-rwxr-xr-xtool/make-snapshot37
1 files changed, 24 insertions, 13 deletions
diff --git a/tool/make-snapshot b/tool/make-snapshot
index 73a97fae0d..04bcf3c2fd 100755
--- a/tool/make-snapshot
+++ b/tool/make-snapshot
@@ -198,6 +198,16 @@ rescue => e
false
end
+def touch_all(time, pattern, opt)
+ Dir.glob(pattern, opt) do |n|
+ File.utime(time, time, n) if File.file?(n) or File.directory?(n)
+ end
+rescue
+ false
+else
+ true
+end
+
def package(vcs, rev, destdir, tmp = nil)
pwd = Dir.pwd
patchlevel = false
@@ -334,25 +344,26 @@ def package(vcs, rev, destdir, tmp = nil)
vcs.chdir(File.expand_path(v = n))
end
system(*%W"patch -d #{v} -p0 -i #{$patch_file}") if $patch_file
- if !$exported or $patch_file
- colors = %w[red yellow green cyan blue magenta]
- "take a breath, and go ahead".scan(/./) do |c|
- if c == ' '
- print c
- else
- colors.push(color = colors.shift)
- print $colorize.decorate(c, color)
- end
- sleep(c == "," ? 0.7 : 0.05)
- end
- puts
- end
def (clean = []).add(n) push(n); n end
Dir.chdir(v) do
unless File.exist?("ChangeLog")
vcs.export_changelog(url, nil, revision, "ChangeLog")
end
+ if !$exported or $patch_file and !touch_all(Time.now - 10, "**/*", File::FNM_DOTMATCH)
+ colors = %w[red yellow green cyan blue magenta]
+ "take a breath, and go ahead".scan(/./) do |c|
+ if c == ' '
+ print c
+ else
+ colors.push(color = colors.shift)
+ print $colorize.decorate(c, color)
+ end
+ sleep(c == "," ? 0.7 : 0.05)
+ end
+ puts
+ end
+
File.open(clean.add("cross.rb"), "w") do |f|
f.puts "Object.__send__(:remove_const, :CROSS_COMPILING) if defined?(CROSS_COMPILING)"
f.puts "CROSS_COMPILING=true"