[前][次][番号順一覧][スレッド一覧]

ruby-changes:7035

From: nobu <ko1@a...>
Date: Wed, 13 Aug 2008 13:09:32 +0900 (JST)
Subject: [ruby-changes:7035] Ruby:r18553 (trunk): * tool/make-snapshot: fix for clean up.

nobu	2008-08-13 13:09:15 +0900 (Wed, 13 Aug 2008)

  New Revision: 18553

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18553

  Log:
    * tool/make-snapshot: fix for clean up.

  Modified files:
    trunk/ChangeLog
    trunk/Makefile.in
    trunk/common.mk
    trunk/tool/make-snapshot

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 18552)
+++ ChangeLog	(revision 18553)
@@ -1,3 +1,7 @@
+Wed Aug 13 13:09:09 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* tool/make-snapshot: fix for clean up.
+
 Wed Aug 13 11:45:51 2008  Akinori MUSHA  <knu@i...>
 
 	* vm_core.h: Declare rb_iseq_clone, which is used in class.c.
Index: common.mk
===================================================================
--- common.mk	(revision 18552)
+++ common.mk	(revision 18553)
@@ -646,7 +646,7 @@
 INSNS2VMOPT = --srcdir="$(srcdir)"
 
 $(INSNS): $(srcdir)/insns.def {$(VPATH)}vm_opts.h
-	$(RM) $(PROGRAM)
+	@$(RM) $(PROGRAM)
 	$(BASERUBY) -Ks $(srcdir)/tool/insns2vm.rb $(INSNS2VMOPT) $@
 
 minsns.inc: $(srcdir)/template/minsns.inc.tmpl
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 18552)
+++ Makefile.in	(revision 18553)
@@ -181,9 +181,12 @@
 # * svn checkout generate a file with mtime as current time
 # * XFS has a mtime with fractional part
 lex.c: keywords
+	@\
 	if cmp -s $(srcdir)/lex.c.src $?; then \
+	  set -x; \
 	  cp $(srcdir)/lex.c.blt $@; \
 	else \
+	  set -x; \
 	  gperf -C -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $? > $@.tmp && \
 	  mv $@.tmp $@ && \
 	  cp $? $(srcdir)/lex.c.src && \
Index: tool/make-snapshot
===================================================================
--- tool/make-snapshot	(revision 18552)
+++ tool/make-snapshot	(revision 18553)
@@ -84,7 +84,7 @@
     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 @@
   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 @@
       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 @@
         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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]