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

ruby-changes:53323

From: sorah <ko1@a...>
Date: Mon, 5 Nov 2018 00:39:05 +0900 (JST)
Subject: [ruby-changes:53323] sorah:r65539 (trunk): Fix RubyGems extension build failure after r65470

sorah	2018-11-05 00:39:00 +0900 (Mon, 05 Nov 2018)

  New Revision: 65539

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

  Log:
    Fix RubyGems extension build failure after r65470
    
    Port of upstream patch https://github.com/rubygems/rubygems/pull/2457
    
    Since r65470 (Upstream: https://github.com/rubygems/rubygems/pull/2441),
    builds of extension gem had always failed under really_verbose mode.

  Modified files:
    trunk/lib/rubygems/ext/builder.rb
Index: lib/rubygems/ext/builder.rb
===================================================================
--- lib/rubygems/ext/builder.rb	(revision 65538)
+++ lib/rubygems/ext/builder.rb	(revision 65539)
@@ -67,12 +67,18 @@ class Gem::Ext::Builder https://github.com/ruby/ruby/blob/trunk/lib/rubygems/ext/builder.rb#L67
       rubygems_gemdeps, ENV['RUBYGEMS_GEMDEPS'] = ENV['RUBYGEMS_GEMDEPS'], nil
       if verbose
         puts("current directory: #{Dir.pwd}")
-        puts(command)
-        system(command)
-      else
-        results << "current directory: #{Dir.pwd}"
-        results << (command.respond_to?(:shelljoin) ? command.shelljoin : command)
-        results << IO.popen(command, "r", err: [:child, :out], &:read)
+        p(command)
+      end
+      results << "current directory: #{Dir.pwd}"
+      results << (command.respond_to?(:shelljoin) ? command.shelljoin : command)
+
+      redirections = verbose ? {} : {err: [:child, :out]}
+      IO.popen(command, "r", redirections) do |io|
+        if verbose
+          IO.copy_stream(io, $stdout)
+        else
+          results << io.read
+        end
       end
     rescue => error
       raise Gem::InstallError, "#{command_name || class_name} failed#{error.message}"

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

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