summaryrefslogtreecommitdiff
path: root/tool/make-snapshot
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-13 04:09:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-13 04:09:15 +0000
commiteaa1bcab351e3d5e835a69687aff8dbee007bb1d (patch)
tree44a17a9b6febec9390839ded94d6b15ed6770552 /tool/make-snapshot
parent7fe95731a811ed3b8775eefe0f7da5e6bec4db93 (diff)
* tool/make-snapshot: fix for clean up.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/make-snapshot')
-rwxr-xr-xtool/make-snapshot20
1 files changed, 11 insertions, 9 deletions
diff --git a/tool/make-snapshot b/tool/make-snapshot
index e0f80c3..65f5bd0 100755
--- a/tool/make-snapshot
+++ b/tool/make-snapshot
@@ -84,7 +84,7 @@ def package(rev, destdir)
end
end
- if !File.directory(v = "ruby")
+ if !File.directory?(v = "ruby")
v = Dir.glob("ruby-*").select(&File.method(:directory?))
v.size == 1 or abort "not exported"
v = v[0]
@@ -102,8 +102,9 @@ def package(rev, destdir)
v = "ruby-#{version}-#{tag}"
File.directory?(v) or File.rename "ruby", v
system("patch -d #{v} -p0 -i #{$patch_file}") if $patch_file
+ def (clean = []).add(n) push(n); n end
Dir.chdir(v) do
- File.open("cross.rb", "w") {|f| f.puts "CROSS_COMPILING=true"}
+ File.open(clean.add("cross.rb"), "w") {|f| f.puts "CROSS_COMPILING=true"}
unless File.exist?("configure")
print "creating configure..."
unless system("autoconf")
@@ -112,13 +113,14 @@ def package(rev, destdir)
end
puts " done"
end
- FileUtils.rm_rf("autom4te.cache")
+ clean.add("autom4te.cache")
print "creating prerequisites..."
if File.file?("common.mk") && /^prereq/ =~ commonmk = IO.read("common.mk")
puts
- File.open("config.status", "w") {|f|
+ extout = clean.add('tmp')
+ File.open(clean.add("config.status"), "w") {|f|
f.puts "s,@configure_args@,|#_!!_#|,g"
- f.puts "s,@EXTOUT@,|#_!!_#|..,g"
+ f.puts "s,@EXTOUT@,|#_!!_#|#{extout},g"
f.puts "s,@bindir@,|#_!!_#|,g"
f.puts "s,@ruby_install_name@,|#_!!_#|,g"
f.puts "s,@ARCH_FLAG@,|#_!!_#|,g"
@@ -131,19 +133,19 @@ def package(rev, destdir)
f.puts "s,@LIBRUBY@,|#_!!_#|liburyb.a,g"
f.puts "s,@LIBRUBY_A@,|#_!!_#|liburyb.a,g"
}
- FileUtils.mkpath("../include/ruby")
- File.open("../include/ruby/config.h", "w") {}
+ FileUtils.mkpath(hdrdir = "#{extout}/include/ruby")
+ File.open("#{hdrdir}/config.h", "w") {}
miniruby = ENV['MINIRUBY'] + " -rcross"
IO.popen("make -f - prereq srcdir=. IFCHANGE=tool/ifchange 'MINIRUBY=#{miniruby}'", "w") do |f|
f.puts(IO.read("Makefile.in")[/^lex\.c.*?^$/m])
f.puts(commonmk.gsub(/\{[^{}]*\}/, ""))
end
- FileUtils.rm_rf("config.status", "../include")
+ clean.push("rbconfig.rb", ".rbconfig.time")
print "prerequisites"
else
system("#{YACC} -o parse.c parse.y")
end
- File.unlink("cross.rb")
+ FileUtils.rm_rf(clean)
unless $?.success?
puts " failed"
return