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

ruby-changes:60328

From: David <ko1@a...>
Date: Sun, 8 Mar 2020 10:19:17 +0900 (JST)
Subject: [ruby-changes:60328] 2b6ec768fc (master): Fix rbinstall bugs (#2930)

https://git.ruby-lang.org/ruby.git/commit/?id=2b6ec768fc

From 2b6ec768fc227650db6ad9eb9af7c4aaea06d986 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Sun, 8 Mar 2020 02:18:53 +0100
Subject: Fix rbinstall bugs (#2930)

* Fix incorrect calls to `Gem.ensure_gem_subdirectories`

This method doesn't take keyword args.

* Remove stuff no longer necessary

Now `Gem.ensure_gem_subdirectories` is doing its job, so some stuff is
no longer needed.

* Use the proper method for default gems

* Respect DESTDIR when creating rubygems folder layout

* Use `Gem.default_specifications_dir`

diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index b1914d7..ce7a8ea 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
@@ -819,12 +819,11 @@ end https://github.com/ruby/ruby/blob/trunk/tool/rbinstall.rb#L819
 
 def install_default_gem(dir, srcdir)
   gem_dir = Gem.default_dir
-  directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode)
-  prepare "default gems from #{dir}", gem_dir, directories
+  install_dir = with_destdir(gem_dir)
+  Gem.ensure_default_gem_subdirectories(install_dir, $dir_mode)
+  prepare "default gems from #{dir}", gem_dir
 
-  spec_dir = File.join(gem_dir, directories.grep(/^spec/)[0])
-  default_spec_dir = "#{spec_dir}/default"
-  makedirs(default_spec_dir)
+  default_spec_dir = Gem.default_specifications_dir
 
   gems = Dir.glob("#{srcdir}/#{dir}/**/*.gemspec").map {|src|
     spec = load_gemspec(src)
@@ -866,9 +865,9 @@ end https://github.com/ruby/ruby/blob/trunk/tool/rbinstall.rb#L865
 
 install?(:ext, :comm, :gem, :'bundled-gems') do
   gem_dir = Gem.default_dir
-  directories = Gem.ensure_gem_subdirectories(gem_dir, :mode => $dir_mode)
-  prepare "bundled gems", gem_dir, directories
   install_dir = with_destdir(gem_dir)
+  Gem.ensure_gem_subdirectories(install_dir, $dir_mode)
+  prepare "bundled gems", gem_dir
   installed_gems = {}
   options = {
     :install_dir => install_dir,
-- 
cgit v0.10.2


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

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