blob: c0efb41eb7ee2bb394a73048f6a8ba6d9009344b (
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
30
31
|
$NetBSD: patch-aq,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
Add install_root option for pkgsrc's rubygems support.
--- lib/rubygems/uninstaller.rb.orig 2010-02-22 02:52:35.000000000 +0000
+++ lib/rubygems/uninstaller.rb
@@ -50,6 +50,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
# only add user directory if install_dir is not set
@user_install = false
@@ -124,7 +129,11 @@ class Gem::Uninstaller
return if spec.nil?
unless spec.executables.empty? then
- bindir = @bin_dir ? @bin_dir : Gem.bindir(spec.installation_path)
+ 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 = @source_index.find_name(spec.name).delete_if { |s|
s.version == spec.version
|