summaryrefslogtreecommitdiff
path: root/misc/rubygems/patches/patch-am
blob: 06eb371329d442e51fc8a21461991615a92883d9 (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
32
33
34
35
36
37
38
$NetBSD: patch-am,v 1.3 2011/08/12 15:50:44 taca Exp $

Make sure to setup under DESTDIR.

--- lib/rubygems/commands/setup_command.rb.orig	2011-05-26 04:01:53.000000000 +0000
+++ lib/rubygems/commands/setup_command.rb
@@ -110,7 +110,7 @@ By default, this RubyGems will install g
 
     uninstall_old_gemcutter
 
-    install_rdoc
+    install_rdoc install_destdir
 
     say
     if @verbose then
@@ -221,16 +221,20 @@ TEXT
     end
   end
 
-  def install_rdoc
+  def install_rdoc(install_destdir)
     gem_doc_dir = File.join Gem.dir, 'doc'
     rubygems_name = "rubygems-#{Gem::VERSION}"
     rubygems_doc_dir = File.join gem_doc_dir, rubygems_name
 
+    unless install_destdir.empty?
+      FileUtils.mkdir_p gem_doc_dir unless File.exist?(gem_doc_dir)
+    end
+
     if File.writable? gem_doc_dir and
        (not File.exist? rubygems_doc_dir or
         File.writable? rubygems_doc_dir) then
       say "Removing old RubyGems RDoc and ri" if @verbose
-      Dir[File.join(Gem.dir, 'doc', 'rubygems-[0-9]*')].each do |dir|
+      Dir[File.join(gem_doc_dir, 'doc', 'rubygems-[0-9]*')].each do |dir|
         rm_rf dir
       end