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

ruby-changes:30307

From: nagachika <ko1@a...>
Date: Sat, 3 Aug 2013 23:08:29 +0900 (JST)
Subject: [ruby-changes:30307] nagachika:r42359 (ruby_2_0_0): merge revision(s) 40080,40081: [Backport #8209]

nagachika	2013-08-03 23:08:18 +0900 (Sat, 03 Aug 2013)

  New Revision: 42359

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

  Log:
    merge revision(s) 40080,40081: [Backport #8209]
    
    * ext/extmk.rb (extmake): Use Logging.open to switch stdout and
      stderr.  Delay Logging::log_close until the failure message is
      written.  Write the failure message only if log file is opened.
    
    * lib/mkmf.rb (Logging.log_opened?): New method.
      [ruby-dev:47215] [Bug #8209]
    
    * ext/extmk.rb (extmake): Invoke Logging::log_close in a ensure
      clause.

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/ext/extmk.rb
    branches/ruby_2_0_0/lib/mkmf.rb
    branches/ruby_2_0_0/version.h

Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 42358)
+++ ruby_2_0_0/ChangeLog	(revision 42359)
@@ -1,3 +1,18 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Sat Aug  3 23:02:09 2013  Tanaka Akira  <akr@f...>
+
+	* ext/extmk.rb (extmake): Invoke Logging::log_close in a ensure
+	  clause.
+
+Sat Aug  3 23:02:09 2013  Tanaka Akira  <akr@f...>
+
+	* ext/extmk.rb (extmake): Use Logging.open to switch stdout and
+	  stderr.  Delay Logging::log_close until the failure message is
+	  written.  Write the failure message only if log file is opened.
+
+	* lib/mkmf.rb (Logging.log_opened?): New method.
+
+	  [ruby-dev:47215] [Bug #8209]
+
 Sat Aug  3 22:46:19 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* lib/mkmf.rb (xsystem): expand environment variable in all macros not
Index: ruby_2_0_0/lib/mkmf.rb
===================================================================
--- ruby_2_0_0/lib/mkmf.rb	(revision 42358)
+++ ruby_2_0_0/lib/mkmf.rb	(revision 42359)
@@ -299,6 +299,10 @@ module MakeMakefile https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/mkmf.rb#L299
       @log.sync = true
     end
 
+    def self::log_opened?
+      @log and not @log.closed?
+    end
+
     def self::open
       log_open
       $stderr.reopen(@log)
Index: ruby_2_0_0/ext/extmk.rb
===================================================================
--- ruby_2_0_0/ext/extmk.rb	(revision 42358)
+++ ruby_2_0_0/ext/extmk.rb	(revision 42359)
@@ -193,19 +193,11 @@ def extmake(target) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ext/extmk.rb#L193
 	  Logging::logfile 'mkmf.log'
 	  rm_f makefile
 	  if conf
-            stdout = $stdout.dup
-            stderr = $stderr.dup
-            unless verbose?
-              $stderr.reopen($stdout.reopen(@null))
-            end
-            begin
+            Logging.open do
+              unless verbose?
+                $stderr.reopen($stdout.reopen(@null))
+              end
               load $0 = conf
-            ensure
-              Logging::log_close
-              $stderr.reopen(stderr)
-              $stdout.reopen(stdout)
-              stdout.close
-              stderr.close
             end
 	  else
 	    create_makefile(target)
@@ -235,7 +227,7 @@ def extmake(target) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ext/extmk.rb#L227
         mess = "#{error}\n#{mess}"
       end
 
-      Logging::message(mess)
+      Logging::message(mess) if Logging.log_opened?
       print(mess)
       $stdout.flush
       return true
@@ -271,6 +263,7 @@ def extmake(target) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ext/extmk.rb#L263
       $extpath |= $LIBPATH
     end
   ensure
+    Logging::log_close
     unless $ignore
       RbConfig.module_eval {
 	remove_const(:CONFIG)
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 42358)
+++ ruby_2_0_0/version.h	(revision 42359)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
 #define RUBY_RELEASE_DATE "2013-08-03"
-#define RUBY_PATCHLEVEL 287
+#define RUBY_PATCHLEVEL 288
 
 #define RUBY_RELEASE_YEAR 2013
 #define RUBY_RELEASE_MONTH 8

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r40080-40081


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

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