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

make-snapshot: download by after-update

* tool/make-snapshot (package): download config files, bundled
  gems, and Unicode data by after-update.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-10-21 03:33:18 +00:00
parent f54774e351
commit 5643b42881

View file

@ -217,15 +217,6 @@ def package(rev, destdir)
"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
Dir.chdir(v) do
%w[config.guess config.sub].each do |conf|
next if File.exist?("tool/#{conf}")
begin
require File.expand_path("downloader", $tooldir)
rescue LoadError
abort "Error!!! Copy 'downloader.rb' from 'tool' directory of the recent ruby repository!"
end
Downloader::GNU.download(conf, "tool")
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"
@ -266,26 +257,19 @@ def package(rev, destdir)
FileUtils.mkpath(hdrdir = "#{extout}/include/ruby")
File.open("#{hdrdir}/config.h", "w") {}
miniruby = ENV['MINIRUBY'] + " -r./cross"
IO.popen("make -f - prereq"\
mk = IO.read("Makefile.in").gsub(/^@.*\n/, '').gsub(/@([A-Za-z_]\w*)@/) {ENV[$1]}
mk << commonmk.gsub(/\{[^{}]*\}/, "")
IO.popen("make -f - #{mk[/^after-update/]} prereq"\
" srcdir=. CHDIR=cd PATH_SEPARATOR='#{File::PATH_SEPARATOR}'"\
" IFCHANGE=tool/ifchange MAKEDIRS='mkdir -p'"\
" 'MINIRUBY=#{miniruby}' 'RUBY=#{ENV["RUBY"]}'", "w") do |f|
f.puts(IO.read("Makefile.in").gsub(/^@.*\n/, '').gsub(/@([A-Za-z_]\w*)@/) {ENV[$1]})
f.puts(commonmk.gsub(/\{[^{}]*\}/, ""))
f.puts mk
end
clean.push("rbconfig.rb", ".rbconfig.time", "enc.mk")
print "prerequisites"
else
system("#{YACC} -o parse.c parse.y")
end
if File.file?('gems/bundled_gems') && bundled_gems = File.read('gems/bundled_gems')
bundled_gems.split("\n").map(&:split).each do |gem, ver|
gem_name = "#{gem}-#{ver}.gem"
unless File.file?("gems/#{gem_name}")
Downloader::RubyGems.download(gem_name, "gems")
end
end
end
FileUtils.rm_rf(clean)
unless $?.success?
puts " failed"