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

ruby-changes:43264

From: nobu <ko1@a...>
Date: Thu, 9 Jun 2016 15:32:22 +0900 (JST)
Subject: [ruby-changes:43264] nobu:r55338 (trunk): common.mk: ifchange for mkconfig.rb

nobu	2016-06-09 15:32:18 +0900 (Thu, 09 Jun 2016)

  New Revision: 55338

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55338

  Log:
    common.mk: ifchange for mkconfig.rb
    
    * common.mk (RBCONFIG): use ifchange tool to see if the content is
      changed and update the timestamp file.
    * tool/mkconfig.rb: remove ifchange features.

  Modified files:
    trunk/ChangeLog
    trunk/common.mk
    trunk/tool/mkconfig.rb
Index: common.mk
===================================================================
--- common.mk	(revision 55337)
+++ common.mk	(revision 55338)
@@ -624,11 +624,12 @@ extconf: $(PREP) https://github.com/ruby/ruby/blob/trunk/common.mk#L624
 	$(RUNRUBY) -C "$(EXTCONFDIR)" $(EXTCONF) $(EXTCONFARGS)
 
 $(RBCONFIG): $(srcdir)/tool/mkconfig.rb config.status $(srcdir)/version.h
-	$(Q)$(BOOTSTRAPRUBY) $(srcdir)/tool/mkconfig.rb -timestamp=$@ \
+	$(Q)$(BOOTSTRAPRUBY) $(srcdir)/tool/mkconfig.rb \
 		-cross_compiling=$(CROSS_COMPILING) \
 		-arch=$(arch) -version=$(RUBY_PROGRAM_VERSION) \
 		-install_name=$(RUBY_INSTALL_NAME) \
-		-so_name=$(RUBY_SO_NAME) rbconfig.rb
+		-so_name=$(RUBY_SO_NAME) | \
+	$(srcdir)/tool/ifchange --timestamp=$@ rbconfig.rb -
 
 test-rubyspec-precheck:
 
Index: tool/mkconfig.rb
===================================================================
--- tool/mkconfig.rb	(revision 55337)
+++ tool/mkconfig.rb	(revision 55338)
@@ -19,17 +19,6 @@ $:.unshift(".") https://github.com/ruby/ruby/blob/trunk/tool/mkconfig.rb#L19
 require "fileutils"
 mkconfig = File.basename($0)
 
-rbconfig_rb = ARGV[0] || 'rbconfig.rb'
-unless File.directory?(dir = File.dirname(rbconfig_rb))
-  FileUtils.makedirs(dir, :verbose => true)
-end
-
-config = ""
-def config.write(arg)
-  concat(arg.to_s)
-end
-$stdout = config
-
 fast = {'prefix'=>TRUE, 'ruby_install_name'=>TRUE, 'INSTALL'=>TRUE, 'EXEEXT'=>TRUE}
 
 win32 = /mswin/ =~ arch
@@ -287,21 +276,4 @@ end https://github.com/ruby/ruby/blob/trunk/tool/mkconfig.rb#L276
 CROSS_COMPILING = nil unless defined? CROSS_COMPILING
 EOS
 
-$stdout = STDOUT
-mode = IO::RDWR|IO::CREAT
-mode |= IO::BINARY if defined?(IO::BINARY)
-open(rbconfig_rb, mode) do |f|
-  if $timestamp and f.stat.size == config.size and f.read == config
-    puts "#{rbconfig_rb} unchanged"
-  else
-    puts "#{rbconfig_rb} updated"
-    f.rewind
-    f.truncate(0)
-    f.print(config)
-  end
-end
-if String === $timestamp
-  FileUtils.touch($timestamp)
-end
-
 # vi:set sw=2:
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 55337)
+++ ChangeLog	(revision 55338)
@@ -1,4 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
-Thu Jun  9 15:31:52 2016  Nobuyoshi Nakada  <nobu@r...>
+Thu Jun  9 15:32:17 2016  Nobuyoshi Nakada  <nobu@r...>
+
+	* common.mk (RBCONFIG): use ifchange tool to see if the content is
+	  changed and update the timestamp file.
+
+	* tool/mkconfig.rb: remove ifchange features.
 
 	* tool/ifchange: make target directory if it does not exist with
 	  its parent directories.

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

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