1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Set mtime of checked out files to past time

instead of waiting 2 seconds, if possible.
This commit is contained in:
Nobuyoshi Nakada 2019-09-02 12:15:35 +09:00
parent 63ab7046a1
commit 1f636e74e6
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -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"