diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-13 04:09:15 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-13 04:09:15 +0000 |
| commit | 3f05b5d023fa081968a7de815cf773b22dc42a45 (patch) | |
| tree | 44a17a9b6febec9390839ded94d6b15ed6770552 /tool | |
| parent | 69a1dd4bddd8b665921ba50eaac02299198a24f1 (diff) | |
| download | ruby-3f05b5d023fa081968a7de815cf773b22dc42a45.tar.gz ruby-3f05b5d023fa081968a7de815cf773b22dc42a45.tar.xz ruby-3f05b5d023fa081968a7de815cf773b22dc42a45.zip | |
* tool/make-snapshot: fix for clean up.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
| -rwxr-xr-x | tool/make-snapshot | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/tool/make-snapshot b/tool/make-snapshot index e0f80c3ba..65f5bd024 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 |
