Wed Feb 19 15:47:33 2014 UTC ()
Check install_root's value is nil before it is empty string.
Reported a problem from @_ki_nu via Twitter.

Bump PKGREVISION.


(taca)
diff -r1.55 -r1.56 pkgsrc/misc/rubygems/Makefile
diff -r1.44 -r1.45 pkgsrc/misc/rubygems/distinfo
diff -r1.17 -r1.18 pkgsrc/misc/rubygems/patches/patch-ab
diff -r1.13 -r1.14 pkgsrc/misc/rubygems/patches/patch-ad
diff -r1.13 -r1.14 pkgsrc/misc/rubygems/patches/patch-ah
diff -r1.10 -r1.11 pkgsrc/misc/rubygems/patches/patch-ag

cvs diff -r1.55 -r1.56 pkgsrc/misc/rubygems/Attic/Makefile (expand / switch to unified diff)

--- pkgsrc/misc/rubygems/Attic/Makefile 2013/09/30 03:12:59 1.55
+++ pkgsrc/misc/rubygems/Attic/Makefile 2014/02/19 15:47:32 1.56
@@ -1,16 +1,17 @@ @@ -1,16 +1,17 @@
1# $NetBSD: Makefile,v 1.55 2013/09/30 03:12:59 taca Exp $ 1# $NetBSD: Makefile,v 1.56 2014/02/19 15:47:32 taca Exp $
2 2
3DISTNAME= rubygems-2.0.10 3DISTNAME= rubygems-2.0.10
 4PKGREVISION= 1
4CATEGORIES= misc ruby 5CATEGORIES= misc ruby
5MASTER_SITES= http://production.cf.rubygems.org/rubygems/ 6MASTER_SITES= http://production.cf.rubygems.org/rubygems/
6EXTRACT_SUFX= .tgz 7EXTRACT_SUFX= .tgz
7 8
8MAINTAINER= taca@NetBSD.org 9MAINTAINER= taca@NetBSD.org
9HOMEPAGE= https://rubygems.org/ 10HOMEPAGE= https://rubygems.org/
10COMMENT= Ruby standard for publishing and managing third party libraries 11COMMENT= Ruby standard for publishing and managing third party libraries
11LICENSE= gnu-gpl-v2 OR ruby-license 12LICENSE= gnu-gpl-v2 OR ruby-license
12 13
13CONFLICTS+= rubygems-[0-9]* 14CONFLICTS+= rubygems-[0-9]*
14 15
15.include "../../mk/bsd.prefs.mk" 16.include "../../mk/bsd.prefs.mk"
16 17

cvs diff -r1.44 -r1.45 pkgsrc/misc/rubygems/Attic/distinfo (expand / switch to unified diff)

--- pkgsrc/misc/rubygems/Attic/distinfo 2013/09/30 03:12:59 1.44
+++ pkgsrc/misc/rubygems/Attic/distinfo 2014/02/19 15:47:32 1.45
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1$NetBSD: distinfo,v 1.44 2013/09/30 03:12:59 taca Exp $ 1$NetBSD: distinfo,v 1.45 2014/02/19 15:47:32 taca Exp $
2 2
3SHA1 (rubygems-2.0.10.tgz) = e4119824649771958038b2347485df85c3a09fc6 3SHA1 (rubygems-2.0.10.tgz) = e4119824649771958038b2347485df85c3a09fc6
4RMD160 (rubygems-2.0.10.tgz) = cc6c5adb29464217067eeab6e06bbb1b67d6cf42 4RMD160 (rubygems-2.0.10.tgz) = cc6c5adb29464217067eeab6e06bbb1b67d6cf42
5Size (rubygems-2.0.10.tgz) = 338280 bytes 5Size (rubygems-2.0.10.tgz) = 338280 bytes
6SHA1 (patch-aa) = ec1af229bb7cf9b36b0b5669b8c6f3d97f7ea15e 6SHA1 (patch-aa) = ec1af229bb7cf9b36b0b5669b8c6f3d97f7ea15e
7SHA1 (patch-ab) = d9fd51322581d0d176479fb6a8f0507ad7cd2b13 7SHA1 (patch-ab) = a960d57b48397fa499c0ee1a91b534eb10574d06
8SHA1 (patch-ac) = 1a59a5d2fc090dfcf6d3bd3b9c133f0ce4a1feee 8SHA1 (patch-ac) = 1a59a5d2fc090dfcf6d3bd3b9c133f0ce4a1feee
9SHA1 (patch-ad) = e44afa7a32095652ef0eea7b146827b60829aee6 9SHA1 (patch-ad) = 40819a75ae0094292417a7c682ed56abd98de1c2
10SHA1 (patch-af) = d96d5dafd830b0c94bf6c191a3274701ebc6d564 10SHA1 (patch-af) = d96d5dafd830b0c94bf6c191a3274701ebc6d564
11SHA1 (patch-ag) = 5b94252ea03eba04849770bc141dfc58de932389 11SHA1 (patch-ag) = 1114e30ce7161a6aa98c3ac6c4ee81f1c22a10d8
12SHA1 (patch-ah) = de58555d7c7e942aa7925ecd1db94769dc5254a1 12SHA1 (patch-ah) = ae9cd39b900793dbb3d22bad88163750e4d120fe
13SHA1 (patch-aj) = 3b77a675470ea3702b9870843d2bb39bb6a83f3e 13SHA1 (patch-aj) = 3b77a675470ea3702b9870843d2bb39bb6a83f3e
14SHA1 (patch-am) = 9146ece86c0bae61553c916adafb2c108f3f07a9 14SHA1 (patch-am) = 9146ece86c0bae61553c916adafb2c108f3f07a9
15SHA1 (patch-ao) = 4a8be3bdab5e465814b626d17a5f2811fbfc808c 15SHA1 (patch-ao) = 4a8be3bdab5e465814b626d17a5f2811fbfc808c
16SHA1 (patch-test_rubygems_test__gem.rb) = 883675c1af0314c66c3d02fb9c012fac768ebb9b 16SHA1 (patch-test_rubygems_test__gem.rb) = 883675c1af0314c66c3d02fb9c012fac768ebb9b

cvs diff -r1.17 -r1.18 pkgsrc/misc/rubygems/patches/Attic/patch-ab (expand / switch to unified diff)

--- pkgsrc/misc/rubygems/patches/Attic/patch-ab 2013/09/10 16:33:29 1.17
+++ pkgsrc/misc/rubygems/patches/Attic/patch-ab 2014/02/19 15:47:32 1.18
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1$NetBSD: patch-ab,v 1.17 2013/09/10 16:33:29 taca Exp $ 1$NetBSD: patch-ab,v 1.18 2014/02/19 15:47:32 taca Exp $
2 2
3Add install_root option for pkgsrc's rubygems support. 3Add install_root option for pkgsrc's rubygems support.
4 4
5--- lib/rubygems/dependency_installer.rb.orig 2013-09-09 23:41:27.000000000 +0000 5--- lib/rubygems/dependency_installer.rb.orig 2013-09-09 23:41:27.000000000 +0000
6+++ lib/rubygems/dependency_installer.rb 6+++ lib/rubygems/dependency_installer.rb
7@@ -50,6 +50,7 @@ class Gem::DependencyInstaller 7@@ -50,6 +50,7 @@ class Gem::DependencyInstaller
8 # :format_executable:: See Gem::Installer#initialize. 8 # :format_executable:: See Gem::Installer#initialize.
9 # :ignore_dependencies:: Don't install any dependencies. 9 # :ignore_dependencies:: Don't install any dependencies.
10 # :install_dir:: See Gem::Installer#install. 10 # :install_dir:: See Gem::Installer#install.
11+ # :install_root:: See Gem::Installer#install. 11+ # :install_root:: See Gem::Installer#install.
12 # :prerelease:: Allow prerelease versions. See #install. 12 # :prerelease:: Allow prerelease versions. See #install.
13 # :security_policy:: See Gem::Installer::new and Gem::Security. 13 # :security_policy:: See Gem::Installer::new and Gem::Security.
14 # :user_install:: See Gem::Installer.new 14 # :user_install:: See Gem::Installer.new
@@ -25,27 +25,27 @@ Add install_root option for pkgsrc's rub @@ -25,27 +25,27 @@ Add install_root option for pkgsrc's rub
25 Gem::Specification.dirs = @install_dir 25 Gem::Specification.dirs = @install_dir
26+ else 26+ else
27+ @install_dir = Gem.dir 27+ @install_dir = Gem.dir
28 end 28 end
29  29
30 options = DEFAULT_OPTIONS.merge options 30 options = DEFAULT_OPTIONS.merge options
31@@ -91,7 +93,12 @@ class Gem::DependencyInstaller 31@@ -91,7 +93,12 @@ class Gem::DependencyInstaller
32 @installed_gems = [] 32 @installed_gems = []
33 @toplevel_specs = nil 33 @toplevel_specs = nil
34  34
35- @cache_dir = options[:cache_dir] || @install_dir 35- @cache_dir = options[:cache_dir] || @install_dir
36+ @install_root = options[:install_root] || "" 36+ @install_root = options[:install_root] || ""
37+ install_dir = @install_dir 37+ install_dir = @install_dir
38+ if not @install_root.empty? 38+ unless @install_root.nil? or @install_root.empty?
39+ install_dir = File.join(@install_root, install_dir) 39+ install_dir = File.join(@install_root, install_dir)
40+ end 40+ end
41+ @cache_dir = options[:cache_dir] || install_dir 41+ @cache_dir = options[:cache_dir] || install_dir
42  42
43 # Set with any errors that SpecFetcher finds while search through 43 # Set with any errors that SpecFetcher finds while search through
44 # gemspecs for a dep 44 # gemspecs for a dep
45@@ -363,6 +370,7 @@ class Gem::DependencyInstaller 45@@ -363,6 +370,7 @@ class Gem::DependencyInstaller
46 :format_executable => @format_executable, 46 :format_executable => @format_executable,
47 :ignore_dependencies => @ignore_dependencies, 47 :ignore_dependencies => @ignore_dependencies,
48 :install_dir => @install_dir, 48 :install_dir => @install_dir,
49+ :install_root => @install_root, 49+ :install_root => @install_root,
50 :security_policy => @security_policy, 50 :security_policy => @security_policy,
51 :user_install => @user_install, 51 :user_install => @user_install,

cvs diff -r1.13 -r1.14 pkgsrc/misc/rubygems/patches/Attic/patch-ad (expand / switch to unified diff)

--- pkgsrc/misc/rubygems/patches/Attic/patch-ad 2013/09/10 16:33:29 1.13
+++ pkgsrc/misc/rubygems/patches/Attic/patch-ad 2014/02/19 15:47:32 1.14
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1$NetBSD: patch-ad,v 1.13 2013/09/10 16:33:29 taca Exp $ 1$NetBSD: patch-ad,v 1.14 2014/02/19 15:47:32 taca Exp $
2 2
3* Add install_root option for pkgsrc's rubygems support. 3* Add install_root option for pkgsrc's rubygems support.
4 4
5--- lib/rubygems/installer.rb.orig 2013-09-09 23:41:27.000000000 +0000 5--- lib/rubygems/installer.rb.orig 2013-09-09 23:41:27.000000000 +0000
6+++ lib/rubygems/installer.rb 6+++ lib/rubygems/installer.rb
7@@ -98,6 +98,9 @@ class Gem::Installer 7@@ -98,6 +98,9 @@ class Gem::Installer
8 # foo_exec18. 8 # foo_exec18.
9 # :ignore_dependencies:: Don't raise if a dependency is missing. 9 # :ignore_dependencies:: Don't raise if a dependency is missing.
10 # :install_dir:: The directory to install the gem into. 10 # :install_dir:: The directory to install the gem into.
11+ # :install_root:: The directory to use as a buildroot for "destdir"-style 11+ # :install_root:: The directory to use as a buildroot for "destdir"-style
12+ # installation. All paths during installation are relative 12+ # installation. All paths during installation are relative
13+ # to the buildroot. 13+ # to the buildroot.
14 # :security_policy:: Use the specified security policy. See Gem::Security 14 # :security_policy:: Use the specified security policy. See Gem::Security
@@ -22,20 +22,20 @@ $NetBSD: patch-ad,v 1.13 2013/09/10 16:3 @@ -22,20 +22,20 @@ $NetBSD: patch-ad,v 1.13 2013/09/10 16:3
22+ :only_install_dir => false, 22+ :only_install_dir => false,
23+ :install_root => nil, 23+ :install_root => nil,
24 }.merge options 24 }.merge options
25  25
26 @env_shebang = options[:env_shebang] 26 @env_shebang = options[:env_shebang]
27@@ -563,8 +567,13 @@ class Gem::Installer 27@@ -563,8 +567,13 @@ class Gem::Installer
28 # If the user has asked for the gem to be installed in a directory that is 28 # If the user has asked for the gem to be installed in a directory that is
29 # the system gem directory, then use the system bin directory, else create 29 # the system gem directory, then use the system bin directory, else create
30 # (or use) a new bin dir under the gem_home. 30 # (or use) a new bin dir under the gem_home.
31- @bin_dir = options[:bin_dir] || Gem.bindir(gem_home) 31- @bin_dir = options[:bin_dir] || Gem.bindir(gem_home)
32+ install_root = options[:install_root] 32+ install_root = options[:install_root]
33+ @bin_dir = options[:bin_dir] || Gem.bindir(gem_home, install_root) 33+ @bin_dir = options[:bin_dir] || Gem.bindir(gem_home, install_root)
34 @development = options[:development] 34 @development = options[:development]
35+ unless install_root.nil? or install_root == "" 35+ unless install_root.nil? or install_root.empty?
36+ @install_root = File.expand_path install_root 36+ @install_root = File.expand_path install_root
37+ @gem_home = File.join(@install_root, @gem_home) 37+ @gem_home = File.join(@install_root, @gem_home)
38+ end 38+ end
39  39
40 @build_args = options[:build_args] || Gem::Command.build_args 40 @build_args = options[:build_args] || Gem::Command.build_args
41 end 41 end

cvs diff -r1.13 -r1.14 pkgsrc/misc/rubygems/patches/Attic/patch-ah (expand / switch to unified diff)

--- pkgsrc/misc/rubygems/patches/Attic/patch-ah 2013/09/10 16:33:29 1.13
+++ pkgsrc/misc/rubygems/patches/Attic/patch-ah 2014/02/19 15:47:32 1.14
@@ -1,35 +1,35 @@ @@ -1,35 +1,35 @@
1$NetBSD: patch-ah,v 1.13 2013/09/10 16:33:29 taca Exp $ 1$NetBSD: patch-ah,v 1.14 2014/02/19 15:47:32 taca Exp $
2 2
3Add install_root option for pkgsrc's rubygems support. 3Add install_root option for pkgsrc's rubygems support.
4 4
5--- lib/rubygems.rb.orig 2013-09-09 23:41:27.000000000 +0000 5--- lib/rubygems.rb.orig 2013-09-09 23:41:27.000000000 +0000
6+++ lib/rubygems.rb 6+++ lib/rubygems.rb
7@@ -291,11 +291,17 @@ module Gem 7@@ -291,11 +291,17 @@ module Gem
8 ## 8 ##
9 # The path where gem executables are to be installed. 9 # The path where gem executables are to be installed.
10  10
11- def self.bindir(install_dir=Gem.dir) 11- def self.bindir(install_dir=Gem.dir)
12+ def self.bindir(install_dir=Gem.dir, install_root=nil) 12+ def self.bindir(install_dir=Gem.dir, install_root=nil)
13 # TODO: move to Gem::Dirs 13 # TODO: move to Gem::Dirs
14- return File.join install_dir, 'bin' unless 14- return File.join install_dir, 'bin' unless
15- install_dir.to_s == Gem.default_dir.to_s 15- install_dir.to_s == Gem.default_dir.to_s
16- Gem.default_bindir 16- Gem.default_bindir
17+ if install_dir.to_s == Gem.default_dir.to_s 17+ if install_dir.to_s == Gem.default_dir.to_s
18+ install_dir = Gem.default_bindir 18+ install_dir = Gem.default_bindir
19+ else 19+ else
20+ install_dir = File.join install_dir, 'bin' 20+ install_dir = File.join install_dir, 'bin'
21+ end 21+ end
22+ unless install_root.nil? 22+ unless install_root.nil? or install_root.empty?
23+ install_dir = File.join install_root, install_dir 23+ install_dir = File.join install_root, install_dir
24+ end 24+ end
25+ install_dir 25+ install_dir
26 end 26 end
27  27
28 ## 28 ##
29@@ -551,12 +557,12 @@ module Gem 29@@ -551,12 +557,12 @@ module Gem
30 ## 30 ##
31 # The index to insert activated gem paths into the $LOAD_PATH. 31 # The index to insert activated gem paths into the $LOAD_PATH.
32 # 32 #
33- # Defaults to the site lib directory unless gem_prelude.rb has loaded paths, 33- # Defaults to the site lib directory unless gem_prelude.rb has loaded paths,
34+ # Defaults to the vendor lib directory unless gem_prelude.rb has loaded paths, 34+ # Defaults to the vendor lib directory unless gem_prelude.rb has loaded paths,
35 # then it inserts the activated gem's paths before the gem_prelude.rb paths 35 # then it inserts the activated gem's paths before the gem_prelude.rb paths

cvs diff -r1.10 -r1.11 pkgsrc/misc/rubygems/patches/Attic/patch-ag (expand / switch to unified diff)

--- pkgsrc/misc/rubygems/patches/Attic/patch-ag 2013/06/11 14:55:54 1.10
+++ pkgsrc/misc/rubygems/patches/Attic/patch-ag 2014/02/19 15:47:32 1.11
@@ -1,31 +1,31 @@ @@ -1,31 +1,31 @@
1$NetBSD: patch-ag,v 1.10 2013/06/11 14:55:54 taca Exp $ 1$NetBSD: patch-ag,v 1.11 2014/02/19 15:47:32 taca Exp $
2 2
3Add install_root option for pkgsrc's rubygems support. 3Add install_root option for pkgsrc's rubygems support.
4 4
5--- lib/rubygems/uninstaller.rb.orig 2013-02-12 20:04:55.000000000 +0000 5--- lib/rubygems/uninstaller.rb.orig 2013-02-12 20:04:55.000000000 +0000
6+++ lib/rubygems/uninstaller.rb 6+++ lib/rubygems/uninstaller.rb
7@@ -51,6 +51,11 @@ class Gem::Uninstaller 7@@ -51,6 +51,11 @@ class Gem::Uninstaller
8 @force_ignore = options[:ignore] 8 @force_ignore = options[:ignore]
9 @bin_dir = options[:bin_dir] 9 @bin_dir = options[:bin_dir]
10 @format_executable = options[:format_executable] 10 @format_executable = options[:format_executable]
11+ install_root = options[:install_root] 11+ install_root = options[:install_root]
12+ unless install_root.nil? or install_root == "" 12+ unless install_root.nil? or install_root.empty?
13+ @install_root = File.expand_path install_root 13+ @install_root = File.expand_path install_root
14+ @gem_home = File.join(@install_root, @gem_home) 14+ @gem_home = File.join(@install_root, @gem_home)
15+ end 15+ end
16  16
17 # Indicate if development dependencies should be checked when 17 # Indicate if development dependencies should be checked when
18 # uninstalling. (default: false) 18 # uninstalling. (default: false)
19@@ -199,7 +204,11 @@ class Gem::Uninstaller 19@@ -199,7 +204,11 @@ class Gem::Uninstaller
20 end 20 end
21  21
22 if remove then 22 if remove then
23- bin_dir = @bin_dir || Gem.bindir(spec.base_dir) 23- bin_dir = @bin_dir || Gem.bindir(spec.base_dir)
24+ bin_dir = @bin_dir || (Gem.bindir @gem_home, @install_root) 24+ bin_dir = @bin_dir || (Gem.bindir @gem_home, @install_root)
25+ 25+
26+ unless @install_root.nil? or @install_root == "" 26+ unless @install_root.nil? or @install_root.empty?
27+ bindir = File.join(@install_root, bindir) 27+ bindir = File.join(@install_root, bindir)
28+ end 28+ end
29  29
30 raise Gem::FilePermissionError, bin_dir unless File.writable? bin_dir 30 raise Gem::FilePermissionError, bin_dir unless File.writable? bin_dir
31  31