summaryrefslogtreecommitdiff
path: root/lib/rubygems/ext
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-14 03:30:02 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-14 03:30:02 +0000
commit4de117a61517e839f2c45eaf45d56fc243d6d5b2 (patch)
tree7cb5af7a7eb513e5dddf5e343746b1611e628387 /lib/rubygems/ext
parente548c09d429a5136285ea81aed418685359ed124 (diff)
* lib/rubygems: Update to RubyGems 2.4.1 master(713ab65)
Complete history at: https://github.com/rubygems/rubygems/blob/master/History.txt#L3-L216 * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/ext')
-rw-r--r--lib/rubygems/ext/builder.rb2
-rw-r--r--lib/rubygems/ext/ext_conf_builder.rb22
2 files changed, 13 insertions, 11 deletions
diff --git a/lib/rubygems/ext/builder.rb b/lib/rubygems/ext/builder.rb
index cbae8234a1..548f1262a8 100644
--- a/lib/rubygems/ext/builder.rb
+++ b/lib/rubygems/ext/builder.rb
@@ -161,7 +161,7 @@ EOF
results = builder.build(extension, @gem_dir, dest_path,
results, @build_args, lib_dir)
- say results.join("\n") if Gem.configuration.really_verbose
+ verbose { results.join("\n") }
end
end
diff --git a/lib/rubygems/ext/ext_conf_builder.rb b/lib/rubygems/ext/ext_conf_builder.rb
index 05506b265b..213bdcb002 100644
--- a/lib/rubygems/ext/ext_conf_builder.rb
+++ b/lib/rubygems/ext/ext_conf_builder.rb
@@ -11,13 +11,15 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
FileEntry = FileUtils::Entry_ # :nodoc:
def self.build(extension, directory, dest_path, results, args=[], lib_dir=nil)
- tmp_dest = Dir.mktmpdir(".gem.", ".")
+ # relative path required as some versions of mktmpdir return an absolute
+ # path which breaks make if it includes a space in the name
+ tmp_dest = get_relative_path(Dir.mktmpdir(".gem.", "."))
t = nil
Tempfile.open %w"siteconf .rb", "." do |siteconf|
t = siteconf
siteconf.puts "require 'rbconfig'"
- siteconf.puts "dest_path = #{(tmp_dest || dest_path).dump}"
+ siteconf.puts "dest_path = #{tmp_dest.dump}"
%w[sitearchdir sitelibdir].each do |dir|
siteconf.puts "RbConfig::MAKEFILE_CONFIG['#{dir}'] = dest_path"
siteconf.puts "RbConfig::CONFIG['#{dir}'] = dest_path"
@@ -25,14 +27,10 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
siteconf.flush
- siteconf_path = File.expand_path siteconf.path
-
- rubyopt = ENV["RUBYOPT"]
destdir = ENV["DESTDIR"]
begin
- ENV["RUBYOPT"] = ["-r#{siteconf_path}", rubyopt].compact.join(' ')
- cmd = [Gem.ruby, File.basename(extension), *args].join ' '
+ cmd = [Gem.ruby, "-r", get_relative_path(siteconf.path), File.basename(extension), *args].join ' '
begin
run cmd, results
@@ -42,7 +40,6 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
end
ENV["DESTDIR"] = nil
- ENV["RUBYOPT"] = rubyopt
make dest_path, results
@@ -57,11 +54,10 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
FileEntry.new(tmp_dest).traverse do |ent|
destent = ent.class.new(dest_path, ent.rel)
- destent.exist? or File.rename(ent.path, destent.path)
+ destent.exist? or FileUtils.mv(ent.path, destent.path)
end
end
ensure
- ENV["RUBYOPT"] = rubyopt
ENV["DESTDIR"] = destdir
end
end
@@ -72,5 +68,11 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
FileUtils.rm_rf tmp_dest if tmp_dest
end
+ private
+ def self.get_relative_path(path)
+ path[0..Dir.pwd.length-1] = '.' if path.start_with?(Dir.pwd)
+ path
+ end
+
end