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

ruby-changes:40350

From: nobu <ko1@a...>
Date: Tue, 3 Nov 2015 16:52:41 +0900 (JST)
Subject: [ruby-changes:40350] nobu:r52431 (trunk): mkmf.rb: log messages

nobu	2015-11-03 16:52:22 +0900 (Tue, 03 Nov 2015)

  New Revision: 52431

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

  Log:
    mkmf.rb: log messages
    
    * lib/mkmf.rb (xsystem, xpopen, egrep_cpp, pkg_config): log
      messages to the log file too.

  Modified files:
    trunk/lib/mkmf.rb
Index: lib/mkmf.rb
===================================================================
--- lib/mkmf.rb	(revision 52430)
+++ lib/mkmf.rb	(revision 52431)
@@ -382,7 +382,9 @@ module MakeMakefile https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L382
       nil while command.gsub!(varpat) {vars[$1||$2]}
     end
     Logging::open do
-      puts command.quote
+      msg = command.quote
+      puts msg
+      Logging.message "%s\n", msg
       if opts and opts[:werror]
         result = nil
         Logging.postpone do |log|
@@ -399,11 +401,15 @@ module MakeMakefile https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L401
 
   def xpopen command, *mode, &block
     Logging::open do
-      case mode[0]
+      msg = case mode[0]
       when nil, /^r/
-        puts "#{command} |"
+        "#{command} |"
       else
-        puts "| #{command}"
+        "| #{command}"
+      end
+      if msg
+        puts msg
+        Logging.message "%s\n", msg
       end
       IO.popen(libpath_env, command, *mode, &block)
     end
@@ -808,13 +814,16 @@ SRC https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L814
     xpopen(cpp_command('', opt)) do |f|
       if Regexp === pat
         puts("    ruby -ne 'print if #{pat.inspect}'")
+        Logging::message("    ruby -ne 'print if %p'\n", pat)
         f.grep(pat) {|l|
           puts "#{f.lineno}: #{l}"
+          Logging::message "%d: %s", f.lineno, l
           return true
         }
         false
       else
         puts("    egrep '#{pat}'")
+        Logging::message("    egrep '%s'\n", pat)
         begin
           stdin = $stdin.dup
           $stdin.reopen(f)
@@ -1792,7 +1801,7 @@ SRC https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L1801
       pkgconfig = $PKGCONFIG
       get = proc {|opt|
         opt = xpopen("#{$PKGCONFIG} --#{opt} #{pkg}", err:[:child, :out], &:read)
-        Logging.open {puts opt.each_line.map{|s|"=> #{s.inspect}"}}
+        Logging.open {opt.each_line.map{|s|Logging.message "=> %p\n", s}}
         opt.strip if $?.success?
       }
     elsif find_executable0(pkgconfig = "#{pkg}-config")
@@ -1803,7 +1812,7 @@ SRC https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L1812
     if pkgconfig
       get ||= proc {|opt|
         opt = xpopen("#{pkgconfig} --#{opt}", err:[:child, :out], &:read)
-        Logging.open {puts opt.each_line.map{|s|"=> #{s.inspect}"}}
+        Logging.open {opt.each_line.map{|s|Logging.message "=> %p\n", s}}
         opt.strip if $?.success?
       }
     end

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

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