* lib/rubygems/ext/ext_conf_builder.rb (build): needs to close
  before unlink on Windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-05-16 05:47:53 +00:00
Родитель 0e7c81a713
Коммит 66b54b1a4a
1 изменённых файлов: 2 добавлений и 4 удалений

Просмотреть файл

@ -27,9 +27,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
# TODO: Make this unconditional when rubygems no longer supports Ruby 1.9.x.
tmp_dest = get_relative_path(tmp_dest) unless Gem.win_platform? && RUBY_VERSION <= '2.0'
t = nil
Tempfile.open %w"siteconf .rb", "." do |siteconf|
t = siteconf
siteconf.puts "require 'rbconfig'"
siteconf.puts "dest_path = #{tmp_dest.dump}"
%w[sitearchdir sitelibdir].each do |dir|
@ -37,7 +35,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
siteconf.puts "RbConfig::CONFIG['#{dir}'] = dest_path"
end
siteconf.flush
siteconf.close
destdir = ENV["DESTDIR"]
@ -78,9 +76,9 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
end
ensure
ENV["DESTDIR"] = destdir
siteconf.close!
end
end
t.unlink if t and t.path
results
ensure