diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-29 06:52:18 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-29 06:52:18 +0000 |
commit | 9694bb8cac12969300692dac5a1cf7aa4e3a46cd (patch) | |
tree | c3cb423d701f7049ba9382de052e2a937cd1302d /lib/rubygems/ext | |
parent | 3f606b7063fc7a8b191556365ad343a314719a8d (diff) | |
download | ruby-9694bb8cac12969300692dac5a1cf7aa4e3a46cd.tar.gz |
* lib/rubygems*: Updated to RubyGems 2.0
* test/rubygems*: ditto.
* common.mk (prelude): Updated for RubyGems 2.0 source rearrangement.
* tool/change_maker.rb: Allow invalid UTF-8 characters in source
files.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/ext')
-rw-r--r-- | lib/rubygems/ext/builder.rb | 26 | ||||
-rw-r--r-- | lib/rubygems/ext/configure_builder.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/ext/ext_conf_builder.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/ext/rake_builder.rb | 4 |
4 files changed, 21 insertions, 17 deletions
diff --git a/lib/rubygems/ext/builder.rb b/lib/rubygems/ext/builder.rb index 5e518962ce..e0e7387d9c 100644 --- a/lib/rubygems/ext/builder.rb +++ b/lib/rubygems/ext/builder.rb @@ -16,7 +16,7 @@ class Gem::Ext::Builder raise Gem::InstallError, "Makefile not found:\n\n#{results.join "\n"}" end - mf = File.read('Makefile') + mf = Gem.read_binary 'Makefile' mf = mf.gsub(/^RUBYARCHDIR\s*=\s*\$[^$]*/, "RUBYARCHDIR = #{dest_path}") mf = mf.gsub(/^RUBYLIBDIR\s*=\s*\$[^$]*/, "RUBYLIBDIR = #{dest_path}") @@ -24,18 +24,14 @@ class Gem::Ext::Builder # try to find make program from Ruby configure arguments first RbConfig::CONFIG['configure_args'] =~ /with-make-prog\=(\w+)/ - make_program = $1 || ENV['make'] + make_program = $1 || ENV['MAKE'] || ENV['make'] unless make_program then make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make' end ['', ' install'].each do |target| cmd = "#{make_program}#{target}" - results << cmd - results << `#{cmd} #{redirector}` - - raise Gem::InstallError, "make#{target} failed:\n\n#{results}" unless - $?.success? + run(cmd, results, "make#{target}") end end @@ -43,12 +39,20 @@ class Gem::Ext::Builder '2>&1' end - def self.run(command, results) - results << command - results << `#{command} #{redirector}` + def self.run(command, results, command_name = nil) + verbose = Gem.configuration.really_verbose + + if verbose + puts(command) + system(command) + else + results << command + results << `#{command} #{redirector}` + end unless $?.success? then - raise Gem::InstallError, "#{class_name} failed:\n\n#{results.join "\n"}" + results << "Building has failed. See above output for more information on the failure." if verbose + raise Gem::InstallError, "#{command_name || class_name} failed:\n\n#{results.join "\n"}" end end diff --git a/lib/rubygems/ext/configure_builder.rb b/lib/rubygems/ext/configure_builder.rb index c2087eb5ad..ef8b29e427 100644 --- a/lib/rubygems/ext/configure_builder.rb +++ b/lib/rubygems/ext/configure_builder.rb @@ -8,10 +8,10 @@ require 'rubygems/ext/builder' class Gem::Ext::ConfigureBuilder < Gem::Ext::Builder - def self.build(extension, directory, dest_path, results) + def self.build(extension, directory, dest_path, results, args=[]) unless File.exist?('Makefile') then cmd = "sh ./configure --prefix=#{dest_path}" - cmd << " #{Gem::Command.build_args.join ' '}" unless Gem::Command.build_args.empty? + cmd << " #{args.join ' '}" unless args.empty? run cmd, results end diff --git a/lib/rubygems/ext/ext_conf_builder.rb b/lib/rubygems/ext/ext_conf_builder.rb index b3d588dc9c..7ca322d3e5 100644 --- a/lib/rubygems/ext/ext_conf_builder.rb +++ b/lib/rubygems/ext/ext_conf_builder.rb @@ -9,9 +9,9 @@ require 'rubygems/command' class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder - def self.build(extension, directory, dest_path, results) + def self.build(extension, directory, dest_path, results, args=[]) cmd = "#{Gem.ruby} #{File.basename extension}" - cmd << " #{Gem::Command.build_args.join ' '}" unless Gem::Command.build_args.empty? + cmd << " #{args.join ' '}" unless args.empty? run cmd, results diff --git a/lib/rubygems/ext/rake_builder.rb b/lib/rubygems/ext/rake_builder.rb index a1df694366..2ac6edd5c8 100644 --- a/lib/rubygems/ext/rake_builder.rb +++ b/lib/rubygems/ext/rake_builder.rb @@ -9,10 +9,10 @@ require 'rubygems/command' class Gem::Ext::RakeBuilder < Gem::Ext::Builder - def self.build(extension, directory, dest_path, results) + def self.build(extension, directory, dest_path, results, args=[]) if File.basename(extension) =~ /mkrf_conf/i then cmd = "#{Gem.ruby} #{File.basename extension}" - cmd << " #{Gem::Command.build_args.join " "}" unless Gem::Command.build_args.empty? + cmd << " #{args.join " "}" unless args.empty? run cmd, results end |