Blame SOURCES/rubygems-2.0.0-Do-not-modify-global-Specification.dirs-during-insta.patch

79386f
From b95b9942361104dc5b7fd08eb4970f893d8c1a54 Mon Sep 17 00:00:00 2001
79386f
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
79386f
Date: Wed, 13 Feb 2013 13:12:30 +0100
79386f
Subject: [PATCH 1/3] Remove duplicated check.
79386f
79386f
The loaded specifications are rejected already in #gather_dependencies,
79386f
so this condition cannot trigger.
79386f
---
79386f
 lib/rubygems/dependency_installer.rb | 3 ---
79386f
 1 file changed, 3 deletions(-)
79386f
79386f
diff --git a/lib/rubygems/dependency_installer.rb b/lib/rubygems/dependency_installer.rb
79386f
index d811f62..dffa8df 100644
79386f
--- a/lib/rubygems/dependency_installer.rb
79386f
+++ b/lib/rubygems/dependency_installer.rb
c3d42c
@@ -337,9 +337,6 @@ class Gem::DependencyInstaller
79386f
 
79386f
     last = @gems_to_install.size - 1
79386f
     @gems_to_install.each_with_index do |spec, index|
79386f
-      # REFACTOR more current spec set hardcoding, should be abstracted?
79386f
-      next if Gem::Specification.include?(spec) and index != last
79386f
-
79386f
       # TODO: make this sorta_verbose so other users can benefit from it
79386f
       say "Installing gem #{spec.full_name}" if Gem.configuration.really_verbose
79386f
 
79386f
-- 
79386f
1.8.1.2
79386f
79386f
From 2fa9087b1986db6c7945c0f997fed2bfff5ce06a Mon Sep 17 00:00:00 2001
79386f
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
79386f
Date: Wed, 13 Feb 2013 15:47:47 +0100
79386f
Subject: [PATCH 2/3] Do not modify global Specification.dirs during
79386f
 installation.
79386f
79386f
While gems are installed into --install-dir just fine even without
79386f
modifications of Specification.dirs, change in it makes inaccessible
79386f
gems already present on the system.
79386f
---
79386f
 lib/rubygems/dependency_installer.rb | 15 ++++++---------
79386f
 1 file changed, 6 insertions(+), 9 deletions(-)
79386f
79386f
diff --git a/lib/rubygems/dependency_installer.rb b/lib/rubygems/dependency_installer.rb
79386f
index dffa8df..841f26a 100644
79386f
--- a/lib/rubygems/dependency_installer.rb
79386f
+++ b/lib/rubygems/dependency_installer.rb
79386f
@@ -57,16 +57,14 @@ class Gem::DependencyInstaller
79386f
   # :build_args:: See Gem::Installer::new
79386f
 
79386f
   def initialize(options = {})
79386f
-    @install_dir = options[:install_dir] || Gem.dir
79386f
 
79386f
     if options[:install_dir] then
79386f
-      # HACK shouldn't change the global settings, needed for -i behavior
79386f
-      # maybe move to the install command?  See also github #442
79386f
-      Gem::Specification.dirs = @install_dir
79386f
+      Gem.ensure_gem_subdirectories options[:install_dir]
79386f
     end
79386f
 
79386f
     options = DEFAULT_OPTIONS.merge options
79386f
 
79386f
+    @install_dir         = options[:install_dir]
79386f
     @bin_dir             = options[:bin_dir]
79386f
     @dev_shallow         = options[:dev_shallow]
79386f
     @development         = options[:development]
c3d42c
@@ -91,7 +89,7 @@ class Gem::DependencyInstaller
79386f
     @installed_gems = []
79386f
     @toplevel_specs = nil
79386f
 
79386f
-    @cache_dir = options[:cache_dir] || @install_dir
79386f
+    @cache_dir = options[:cache_dir] || @install_dir || Gem.dir
79386f
 
79386f
     # Set with any errors that SpecFetcher finds while search through
79386f
     # gemspecs for a dep
c3d42c
@@ -201,7 +199,7 @@ class Gem::DependencyInstaller
79386f
     # that this isn't dependent only on the currently installed gems
79386f
     dependency_list.specs.reject! { |spec|
79386f
       not keep_names.include?(spec.full_name) and
79386f
-      Gem::Specification.include?(spec)
79386f
+      (!@install_dir && Gem::Specification.include?(spec))
79386f
     }
79386f
 
79386f
     unless dependency_list.ok? or @ignore_dependencies or @force then
c3d42c
@@ -253,7 +251,7 @@ class Gem::DependencyInstaller
79386f
           to_do.push t.spec
79386f
         end
79386f
 
79386f
-        results.remove_installed! dep
79386f
+        results.remove_installed! dep unless @install_dir
79386f
 
79386f
         @available << results
79386f
         results.inject_into_list dependency_list
c3d42c
@@ -367,7 +365,7 @@ class Gem::DependencyInstaller
79386f
                                 :force               => @force,
79386f
                                 :format_executable   => @format_executable,
79386f
                                 :ignore_dependencies => @ignore_dependencies,
79386f
-                                :install_dir         => @install_dir,
79386f
+                                :install_dir         => (@install_dir || Gem.dir),
79386f
                                 :security_policy     => @security_policy,
79386f
                                 :user_install        => @user_install,
79386f
                                 :wrappers            => @wrappers,
79386f
-- 
79386f
1.8.1.2
79386f
79386f
79386f
From d473204ce920702dd87257db49355929f31530d4 Mon Sep 17 00:00:00 2001
79386f
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
79386f
Date: Fri, 15 Feb 2013 17:02:44 +0100
79386f
Subject: [PATCH 3/3] Default to Gem.dir as late as possible.
79386f
79386f
---
79386f
 lib/rubygems/dependency_installer.rb | 2 +-
79386f
 lib/rubygems/installer.rb            | 4 ++--
79386f
 2 files changed, 3 insertions(+), 3 deletions(-)
79386f
79386f
diff --git a/lib/rubygems/dependency_installer.rb b/lib/rubygems/dependency_installer.rb
79386f
index 841f26a..abcfa0f 100644
79386f
--- a/lib/rubygems/dependency_installer.rb
79386f
+++ b/lib/rubygems/dependency_installer.rb
c3d42c
@@ -365,7 +365,7 @@ class Gem::DependencyInstaller
79386f
                                 :force               => @force,
79386f
                                 :format_executable   => @format_executable,
79386f
                                 :ignore_dependencies => @ignore_dependencies,
79386f
-                                :install_dir         => (@install_dir || Gem.dir),
79386f
+                                :install_dir         => @install_dir,
79386f
                                 :security_policy     => @security_policy,
79386f
                                 :user_install        => @user_install,
79386f
                                 :wrappers            => @wrappers,
79386f
diff --git a/lib/rubygems/installer.rb b/lib/rubygems/installer.rb
79386f
index 780a88b..6543130 100644
79386f
--- a/lib/rubygems/installer.rb
79386f
+++ b/lib/rubygems/installer.rb
c3d42c
@@ -547,13 +547,13 @@ class Gem::Installer
79386f
       :bin_dir      => nil,
79386f
       :env_shebang  => false,
79386f
       :force        => false,
79386f
-      :install_dir  => Gem.dir,
79386f
       :only_install_dir => false
79386f
     }.merge options
79386f
 
79386f
     @env_shebang         = options[:env_shebang]
79386f
     @force               = options[:force]
79386f
-    @gem_home            = options[:install_dir]
79386f
+    @install_dir         = options[:install_dir]
79386f
+    @gem_home            = options[:install_dir] || Gem.dir
79386f
     @ignore_dependencies = options[:ignore_dependencies]
79386f
     @format_executable   = options[:format_executable]
79386f
     @security_policy     = options[:security_policy]
79386f
-- 
79386f
1.8.1.2
79386f