Fix "gem install --install-dir" behavior.

This commit is contained in:
Vít Ondruch 2013-02-06 16:56:47 +01:00
parent 2096cfc8bc
commit e811eb017b
3 changed files with 94 additions and 37 deletions

View File

@ -110,14 +110,12 @@ Patch9: rubygems-1.8.11-binary-extensions.patch
Patch10: ruby-2.0.0-Expand-ruby.pc-variable-by-configuration-process.patch
# Make mkmf verbose by default
Patch12: ruby-1.9.3-mkmf-verbose.patch
# http://bugs.ruby-lang.org/issues/7629
# https://bugzilla.redhat.com/show_bug.cgi?id=895173
# save the proc made from the given block
# Fixed in p374
#Patch13: ruby-1.9.3-p327-PR7629-save-proc.patch
# Fixes issues mentioned in rhbz#789532, comment 8.
# TODO: Should be probably upstreamed with #5281.
Patch14: ruby-2.0.0-Expand-ruby.pc-variable-by-configuration-process.patch
# This slightly changes behavior of "gem install --install-dir" behavior.
# Without this patch, Specifications.dirs is modified and gems installed on
# the system cannot be required anymore. This causes later issues when RDoc
# documentation should be generated, since json gem is sudenly not accessible.
# https://github.com/rubygems/rubygems/pull/442
Patch13: rubygems-2.0.0-Do-not-modify-global-Specification.dirs-during-insta.patch
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires: ruby(rubygems) >= %{rubygems_version}
@ -379,8 +377,7 @@ Tcl/Tk interface for the object-oriented scripting language Ruby.
%patch9 -p1
%patch10 -p1
%patch12 -p1
#%%patch13 -p1
%patch14 -p1
%patch13 -p1
# Provide an example of usage of the tapset:
cp -a %{SOURCE3} .

View File

@ -1,14 +1,14 @@
From 5a37a3489491a33f2e7011043fbbcd9a765e1777 Mon Sep 17 00:00:00 2001
From ec90622235ae19b28a327cb50a10e0311e8f3d71 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Thu, 3 Nov 2011 16:43:05 +0100
Subject: [PATCH 1/6] Add dedicate extensions folder into $LOAD_PATH.
Subject: [PATCH 1/7] Add dedicate extensions folder into $LOAD_PATH.
---
lib/rubygems/specification.rb | 32 ++++++++++++++++++++++++++++++--
1 file changed, 30 insertions(+), 2 deletions(-)
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
index 97db19e..263e7d3 100644
index cabdf8d..87b14d2 100644
--- a/lib/rubygems/specification.rb
+++ b/lib/rubygems/specification.rb
@@ -1256,6 +1256,12 @@ class Gem::Specification
@ -68,13 +68,13 @@ index 97db19e..263e7d3 100644
#
# Formerly used to indicate this gem was RDoc-capable.
--
1.8.0
1.8.1
From 671e4285bf9db948bc5f054d7d3d931cdd7a17f8 Mon Sep 17 00:00:00 2001
From e42819f32fc5d935f7e7189ec4be8bdab0a2cf3f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Wed, 16 Nov 2011 13:26:48 +0100
Subject: [PATCH 2/6] Use spec's ext dir for extension installation.
Subject: [PATCH 2/7] Use spec's ext dir for extension installation.
---
lib/rubygems/installer.rb | 2 +-
@ -82,7 +82,7 @@ Subject: [PATCH 2/6] Use spec's ext dir for extension installation.
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
index 74d803d..0063c7f 100644
index 780a88b..854c177 100644
--- a/lib/rubygems/installer.rb
+++ b/lib/rubygems/installer.rb
@@ -642,7 +642,7 @@ TEXT
@ -95,7 +95,7 @@ index 74d803d..0063c7f 100644
spec.extensions.each do |extension|
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
index 263e7d3..d31b93b 100644
index 87b14d2..492ddbe 100644
--- a/lib/rubygems/specification.rb
+++ b/lib/rubygems/specification.rb
@@ -1689,16 +1689,15 @@ class Gem::Specification
@ -119,20 +119,20 @@ index 263e7d3..d31b93b 100644
##
--
1.8.0
1.8.1
From 11b4a0cbadd8b1d3320f838881aa60feb6f848e7 Mon Sep 17 00:00:00 2001
From 0e9dd0655111f7dda805233c79a3771459d9a66a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Wed, 16 Nov 2011 14:52:16 +0100
Subject: [PATCH 3/6] Simplify the extending of $LOAD_PATH for binary gems.
Subject: [PATCH 3/7] Simplify the extending of $LOAD_PATH for binary gems.
---
lib/rubygems/specification.rb | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
index d31b93b..e65ea2d 100644
index 492ddbe..c703827 100644
--- a/lib/rubygems/specification.rb
+++ b/lib/rubygems/specification.rb
@@ -1256,11 +1256,7 @@ class Gem::Specification
@ -161,13 +161,13 @@ index d31b93b..e65ea2d 100644
##
--
1.8.0
1.8.1
From 5d46cd2b1ac9517a9cbcfa430261e62bb3a376b8 Mon Sep 17 00:00:00 2001
From 9a8556c609e800d0dbd24af416d613f2e82f323c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Fri, 9 Dec 2011 16:31:04 +0100
Subject: [PATCH 4/6] Fix the binary extension search path construction.
Subject: [PATCH 4/7] Fix the binary extension search path construction.
---
lib/rubygems/installer.rb | 2 +-
@ -175,7 +175,7 @@ Subject: [PATCH 4/6] Fix the binary extension search path construction.
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
index 0063c7f..83b8fd5 100644
index 854c177..f1f2ad7 100644
--- a/lib/rubygems/installer.rb
+++ b/lib/rubygems/installer.rb
@@ -642,7 +642,7 @@ TEXT
@ -188,7 +188,7 @@ index 0063c7f..83b8fd5 100644
spec.extensions.each do |extension|
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
index e65ea2d..8be2ade 100644
index c703827..fa9ea6e 100644
--- a/lib/rubygems/specification.rb
+++ b/lib/rubygems/specification.rb
@@ -1256,7 +1256,7 @@ class Gem::Specification
@ -210,20 +210,20 @@ index e65ea2d..8be2ade 100644
##
--
1.8.0
1.8.1
From 6229583633802b45e5a3e5689ab9077347cd9ef7 Mon Sep 17 00:00:00 2001
From 476c2f90cc6f5f490858f253a9b23eb19d53d2fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Tue, 13 Dec 2011 12:14:54 +0100
Subject: [PATCH 5/6] Remove binary extensions during uninstall.
Subject: [PATCH 5/7] Remove binary extensions during uninstall.
---
lib/rubygems/uninstaller.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/rubygems/uninstaller.rb b/lib/rubygems/uninstaller.rb
index cc32ea4..94d78e0 100644
index d672b9d..5c31a0c 100644
--- a/lib/rubygems/uninstaller.rb
+++ b/lib/rubygems/uninstaller.rb
@@ -246,6 +246,7 @@ class Gem::Uninstaller
@ -235,13 +235,13 @@ index cc32ea4..94d78e0 100644
# TODO: should this be moved to spec?... I vote eww (also exists in docmgr)
old_platform_name = [spec.name,
--
1.8.0
1.8.1
From bc40e1b9f60a9a04456e3504ffe6ee600b6da269 Mon Sep 17 00:00:00 2001
From 35dc17e86f701fe1be80d98ace79735c535fd570 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Tue, 13 Dec 2011 14:27:14 +0100
Subject: [PATCH 6/6] Avoid dependency on customized operating_system.rb.
Subject: [PATCH 6/7] Avoid dependency on customized operating_system.rb.
---
lib/rubygems/defaults.rb | 11 +++++++++++
@ -249,7 +249,7 @@ Subject: [PATCH 6/6] Avoid dependency on customized operating_system.rb.
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/lib/rubygems/defaults.rb b/lib/rubygems/defaults.rb
index 20b4198..6d8711f 100644
index ea84e5c..b221954 100644
--- a/lib/rubygems/defaults.rb
+++ b/lib/rubygems/defaults.rb
@@ -101,6 +101,17 @@ module Gem
@ -271,7 +271,7 @@ index 20b4198..6d8711f 100644
def self.ruby_engine
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
index 8be2ade..f54210a 100644
index fa9ea6e..2b10499 100644
--- a/lib/rubygems/specification.rb
+++ b/lib/rubygems/specification.rb
@@ -1693,10 +1693,7 @@ class Gem::Specification
@ -287,5 +287,32 @@ index 8be2ade..f54210a 100644
##
--
1.8.0
1.8.1
From 0937c0b0a3c2ed08ab5b0875f7f95e24157525c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Thu, 7 Feb 2013 13:07:34 +0100
Subject: [PATCH 7/7] Fix binary extensions installation when --install-dir is
specified.
---
lib/rubygems/installer.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
index f1f2ad7..e1577fc 100644
--- a/lib/rubygems/installer.rb
+++ b/lib/rubygems/installer.rb
@@ -642,7 +642,7 @@ TEXT
say "This could take a while..."
end
- dest_path = File.join spec.ext_dir, spec.require_paths.first
+ dest_path = File.join(options[:install_dir] ? gem_dir : spec.ext_dir, spec.require_paths.first)
ran_rake = false # only run rake once
spec.extensions.each do |extension|
--
1.8.1

View File

@ -0,0 +1,33 @@
From 95ee154e3f3d324f5dcd47ed76f26194f727b5d3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Wed, 6 Feb 2013 14:07:30 +0100
Subject: [PATCH] Do not modify global Specification.dirs during installation.
While gems are installed into --install-dir just fine even without
modifications of Specification.dirs, change in it makes inaccessible
gems already present on the system.
---
lib/rubygems/dependency_installer.rb | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/lib/rubygems/dependency_installer.rb b/lib/rubygems/dependency_installer.rb
index ed90af0..8b6f93f 100644
--- a/lib/rubygems/dependency_installer.rb
+++ b/lib/rubygems/dependency_installer.rb
@@ -58,12 +58,7 @@ class Gem::DependencyInstaller
def initialize(options = {})
if options[:install_dir] then
- @gem_home = options[:install_dir]
-
- # HACK shouldn't change the global settings
- Gem::Specification.dirs = @gem_home
- Gem.ensure_gem_subdirectories @gem_home
- options[:install_dir] = @gem_home # FIX: because we suck and reuse below
+ Gem.ensure_gem_subdirectories options[:install_dir]
end
options = DEFAULT_OPTIONS.merge options
--
1.8.1