make-snapshot: fix gems update

* tool/make-snapshot (package): call system and IO.popen with
  arguments array, add macros NULLCMD and RUNRUBY to update gems,
  and not subsitute string interpolations which are used in
  update-gems.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-10-24 08:16:52 +00:00
parent b5f3b4cb09
commit 0b9aac597f

View File

@ -171,7 +171,7 @@ def package(rev, destdir)
else else
v = "ruby" v = "ruby"
puts "Exporting #{rev}@#{revision}" puts "Exporting #{rev}@#{revision}"
IO.popen("svn export -r #{revision} #{url} #{v}") do |pipe| IO.popen(%W"svn export -r #{revision} #{url} #{v}") do |pipe|
pipe.each {|line| /^A/ =~ line or print line} pipe.each {|line| /^A/ =~ line or print line}
end end
unless $?.success? unless $?.success?
@ -213,7 +213,7 @@ def package(rev, destdir)
File.directory?(n) or File.rename v, n File.directory?(n) or File.rename v, n
v = n v = n
end end
system("patch -d #{v} -p0 -i #{$patch_file}") if $patch_file system(*%W"patch -d #{v} -p0 -i #{$patch_file}") if $patch_file
"take a breath, and go ahead".scan(/./) {|c|print c; sleep(c == "," ? 0.7 : 0.05)}; puts "take a breath, and go ahead".scan(/./) {|c|print c; sleep(c == "," ? 0.7 : 0.05)}; puts
def (clean = []).add(n) push(n); n end def (clean = []).add(n) push(n); n end
Dir.chdir(v) do Dir.chdir(v) do
@ -223,7 +223,7 @@ def package(rev, destdir)
end end
unless File.exist?("configure") unless File.exist?("configure")
print "creating configure..." print "creating configure..."
unless system(ENV["AUTOCONF"]) unless system([ENV["AUTOCONF"]]*2)
puts " failed" puts " failed"
return return
end end
@ -256,19 +256,25 @@ def package(rev, destdir)
} }
FileUtils.mkpath(hdrdir = "#{extout}/include/ruby") FileUtils.mkpath(hdrdir = "#{extout}/include/ruby")
File.open("#{hdrdir}/config.h", "w") {} File.open("#{hdrdir}/config.h", "w") {}
miniruby = ENV['MINIRUBY'] + " -r./cross" miniruby = ENV['MINIRUBY'] + " -I. -rcross"
mk = IO.read("Makefile.in").gsub(/^@.*\n/, '').gsub(/@([A-Za-z_]\w*)@/) {ENV[$1]} mk = IO.read("Makefile.in").gsub(/^@.*\n/, '').gsub(/@([A-Za-z_]\w*)@/) {ENV[$1]}
mk << commonmk.gsub(/\{[^{}]*\}/, "") mk << commonmk.gsub(/(?<!#)\{[^{}]*\}/, "")
IO.popen("make -f - #{mk[/^after-update/]} prereq"\ cmd = %W[make -f -
" srcdir=. CHDIR=cd PATH_SEPARATOR='#{File::PATH_SEPARATOR}'"\ srcdir=. CHDIR=cd NULLCMD=:
" IFCHANGE=tool/ifchange MAKEDIRS='mkdir -p'"\ PATH_SEPARATOR=#{File::PATH_SEPARATOR}
" 'MINIRUBY=#{miniruby}' 'RUBY=#{ENV["RUBY"]}'", "w") do |f| IFCHANGE=tool/ifchange MAKEDIRS=mkdir\ -p
MINIRUBY=#{miniruby}
RUNRUBY=#{miniruby}
RUBY=#{ENV["RUBY"]}
prereq]
IO.popen(cmd, "w") do |f|
f.puts mk f.puts mk
f.puts "after-update::", "prereq: after-update"
end end
clean.push("rbconfig.rb", ".rbconfig.time", "enc.mk") clean.push("rbconfig.rb", ".rbconfig.time", "enc.mk")
print "prerequisites" print "prerequisites"
else else
system("#{YACC} -o parse.c parse.y") system(*%W"#{YACC} -o parse.c parse.y")
end end
FileUtils.rm_rf(clean) FileUtils.rm_rf(clean)
unless $?.success? unless $?.success?
@ -307,10 +313,10 @@ def package(rev, destdir)
end end
end end
print "creating #{mesg} tarball... #{file}" print "creating #{mesg} tarball... #{file}"
done = system(*(cmd + [tarball]), out: file) done = system(*cmd, tarball, out: file)
else else
print "creating #{mesg} archive... #{file}" print "creating #{mesg} archive... #{file}"
done = system(*(cmd + [file, v])) done = system(*cmd, file, v)
end end
if done if done
puts " done" puts " done"