pkgsrc/lang/ruby22-base/patches/patch-lib_rubygems_commands_setup__command.rb
taca 99680f5c7d Adding Ruby 2.2.1 package, this is ruby22-base.
From release announce:

We are pleased to announce the release of Ruby 2.2.1. This is the first TEENY
version release of the stable 2.2 series.

This release includes the fix for ffi build failure and memory leak issue on
Symbol GC (See Bug #10686).

See ChangeLog for details.
2015-03-08 16:24:55 +00:00

41 lines
1.3 KiB
Ruby

$NetBSD: patch-lib_rubygems_commands_setup__command.rb,v 1.1 2015/03/08 16:24:55 taca Exp $
* Make sure to setup under DESTDIR.
--- lib/rubygems/commands/setup_command.rb.orig 2014-09-14 03:30:02.000000000 +0000
+++ lib/rubygems/commands/setup_command.rb
@@ -145,7 +145,7 @@ By default, this RubyGems will install g
uninstall_old_gemcutter
- documentation_success = install_rdoc
+ documentation_success = install_rdoc install_destdir
say
if @verbose then
@@ -284,11 +284,15 @@ 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
+
begin
Gem.ensure_gem_subdirectories Gem.dir
rescue SystemCallError
@@ -299,7 +303,7 @@ TEXT
(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, 'rubygems-[0-9]*')].each do |dir|
rm_rf dir
end