summaryrefslogtreecommitdiff
path: root/misc/rubygems/patches/patch-ag
blob: c8f9983efd111bf01550fe4d4765e1dc49fdbba5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
$NetBSD: patch-ag,v 1.1 2008/03/31 15:40:43 jlam Exp $

--- lib/rubygems/uninstaller.rb.orig	2008-02-23 22:05:54.000000000 -0500
+++ lib/rubygems/uninstaller.rb
@@ -31,6 +31,11 @@ class Gem::Uninstaller
     @force_all = options[:all]
     @force_ignore = options[:ignore]
     @bin_dir = options[:bin_dir] 
+    install_root = options[:install_root]
+    unless install_root.nil? or install_root == ""
+      @install_root = File.expand_path install_root
+      @gem_home = File.join(@install_root, @gem_home)
+    end
   end
 
   ##
@@ -74,7 +79,11 @@ class Gem::Uninstaller
     return if gemspec.nil?
 
     if gemspec.executables.size > 0 then
-      bindir = @bin_dir ? @bin_dir : (Gem.bindir @gem_home)
+      bindir = @bin_dir ? @bin_dir : (Gem.bindir @gem_home, @install_root)
+
+      unless @install_root.nil? or @install_root == ""
+        bindir = File.join(@install_root, bindir)
+      end
 
       list = Gem.source_index.search(gemspec.name).delete_if { |spec|
         spec.version == gemspec.version