[rubygems] Fix Gem.latest_load_paths (for rubygem-gettext FTBFS) Fix Gem.all_load_paths (for rubygem-gettext FT

Mamoru Tasaka mtasaka at fedoraproject.org
Sat Jun 25 11:56:07 UTC 2011


commit afd6f3ebbf04651a58d8695092334dbb92f5436c
Author: Mamoru Tasaka <tasaka1 at localhost.localdomain>
Date:   Sat Jun 25 20:55:46 2011 +0900

    Fix Gem.latest_load_paths (for rubygem-gettext FTBFS)
    Fix Gem.all_load_paths (for rubygem-gettext FTBFS, although it is already
    deprecated from 1.7.0)

 rubygems-1.8.5-all-load-paths.patch                |   12 +++
 ...-fix-Gem.latest_load_paths-partial-revert.patch |   11 +++
 rubygems-1.8.5-fix-Gem.latest_load_paths.patch     |   78 ++++++++++++++++++++
 rubygems.spec                                      |   21 +++++-
 4 files changed, 121 insertions(+), 1 deletions(-)
---
diff --git a/rubygems-1.8.5-all-load-paths.patch b/rubygems-1.8.5-all-load-paths.patch
new file mode 100644
index 0000000..470ddbf
--- /dev/null
+++ b/rubygems-1.8.5-all-load-paths.patch
@@ -0,0 +1,12 @@
+--- rubygems-1.8.5/lib/rubygems.rb.all_load_paths	2011-06-25 13:57:51.000000000 +0900
++++ rubygems-1.8.5/lib/rubygems.rb	2011-06-25 15:03:26.000000000 +0900
+@@ -258,7 +258,8 @@
+ 
+     Gem.path.each do |gemdir|
+       each_load_path all_partials(gemdir) do |load_path|
+-        result << gemdir.add(load_path).expand_path
++#        result << gemdir.add(load_path).expand_path
++        result << load_path
+       end
+     end
+ 
diff --git a/rubygems-1.8.5-fix-Gem.latest_load_paths-partial-revert.patch b/rubygems-1.8.5-fix-Gem.latest_load_paths-partial-revert.patch
new file mode 100644
index 0000000..b3e58fc
--- /dev/null
+++ b/rubygems-1.8.5-fix-Gem.latest_load_paths-partial-revert.patch
@@ -0,0 +1,11 @@
+--- rubygems-1.8.5/test/rubygems/test_gem.rb.debug	2011-06-25 03:11:55.000000000 +0900
++++ rubygems-1.8.5/test/rubygems/test_gem.rb	2011-06-25 04:00:47.000000000 +0900
+@@ -1083,7 +1083,7 @@
+     # @abin_path = File.join spec.full_gem_path, spec.bindir, 'abin'
+     # FileUtils.mkdir_p File.join(stem, "gems", "test-3")
+ 
+-    Gem::Deprecate.skip_during do
++    Deprecate.skip_during do
+       expected = [File.join(@gemhome, "gems", "a-4", "lib")]
+       assert_equal expected, Gem.latest_load_paths
+     end
diff --git a/rubygems-1.8.5-fix-Gem.latest_load_paths.patch b/rubygems-1.8.5-fix-Gem.latest_load_paths.patch
new file mode 100644
index 0000000..1e2038a
--- /dev/null
+++ b/rubygems-1.8.5-fix-Gem.latest_load_paths.patch
@@ -0,0 +1,78 @@
+From 30d6b6807894acf81e46e836b1eb091d253a180c Mon Sep 17 00:00:00 2001
+From: Evan Phoenix <evan at fallingsnow.net>
+Date: Wed, 1 Jun 2011 21:18:13 -0700
+Subject: [PATCH] Fix Gem.latest_load_paths
+
+---
+ lib/rubygems.rb           |   14 +++++++-------
+ test/rubygems/test_gem.rb |   19 +++++++++++++++++++
+ 2 files changed, 26 insertions(+), 7 deletions(-)
+
+diff --git a/lib/rubygems.rb b/lib/rubygems.rb
+index fbeeeb8..b99a189 100644
+--- a/lib/rubygems.rb
++++ b/lib/rubygems.rb
+@@ -423,15 +423,15 @@ module Gem
+   def self.each_load_path(partials)
+     partials.each do |gp|
+       base = File.basename gp
+-      specfn = dir.specifications.add(base + ".gemspec")
+-      if specfn.exist?
+-        spec = eval(specfn.read)
++      specfn = File.join(dir, "specifications", "#{base}.gemspec")
++      if File.exists? specfn
++        spec = eval(File.read(specfn))
+         spec.require_paths.each do |rp|
+-          yield(gp.add(rp))
++          yield File.join(gp,rp)
+         end
+       else
+-        filename = dir.add(gp, 'lib')
+-        yield(filename) if filename.exist?
++        filename = File.join(gp, 'lib')
++        yield(filename) if File.exists? filename
+       end
+     end
+   end
+@@ -586,7 +586,7 @@ module Gem
+ 
+     Gem.path.each do |gemdir|
+       each_load_path(latest_partials(gemdir)) do |load_path|
+-        result << gemdir.add(load_path).expand_path
++        result << load_path
+       end
+     end
+ 
+diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb
+index 066f982..defd3c0 100644
+--- a/test/rubygems/test_gem.rb
++++ b/test/rubygems/test_gem.rb
+@@ -1076,6 +1076,25 @@ class TestGem < Gem::TestCase
+     assert_equal :loaded, TEST_PLUGIN_EXCEPTION rescue nil
+   end
+ 
++  def test_latest_load_paths
++    stem = Gem.path.first
++
++    spec = quick_spec 'a', '4' do |s|
++      s.require_paths = ["lib"]
++    end
++
++    install_gem spec
++
++    # @exec_path = File.join spec.full_gem_path, spec.bindir, 'exec'
++    # @abin_path = File.join spec.full_gem_path, spec.bindir, 'abin'
++    # FileUtils.mkdir_p File.join(stem, "gems", "test-3")
++
++    Gem::Deprecate.skip_during do
++      expected = [File.join(@gemhome, "gems", "a-4", "lib")]
++      assert_equal expected, Gem.latest_load_paths
++    end
++  end
++
+   def with_plugin(path)
+     test_plugin_path = File.expand_path("test/rubygems/plugin/#{path}",
+                                         @@project_dir)
+-- 
+1.7.5.4
+
diff --git a/rubygems.spec b/rubygems.spec
index 0ad03fa..7779e28 100644
--- a/rubygems.spec
+++ b/rubygems.spec
@@ -15,7 +15,7 @@
 Summary:	The Ruby standard for packaging ruby libraries
 Name:		rubygems
 Version:	1.8.5
-Release:	1%{?dist}
+Release:	2%{?dist}
 Group:		Development/Libraries
 License:	Ruby or MIT
 
@@ -23,10 +23,21 @@ URL:		http://rubyforge.org/projects/rubygems/
 Source0:	http://rubyforge.org/frs/download.php/%{repoid}/rubygems-%{version}.tgz
 Patch0:		rubygems-1.8.5-noarch-gemdir.patch
 # Will discuss upstream
+# https://github.com/rubygems/rubygems/issues/120
 # rubygems-Patches-28631
 Patch1:		rubygems-1.8.5-show-extension-build-process-in-sync.patch
 # rubygems-Patches-29049
+# https://github.com/rubygems/rubygems/issues/118
 Patch3:		rubygems-1.8.5-show-rdoc-process-verbosely.patch
+# rubygems bug 29232
+# undefined method `specifications' for "...path":String
+# commit 30d6b6807894acf81e46
+Patch4:		rubygems-1.8.5-fix-Gem.latest_load_paths.patch
+# For now Patch4 needs below
+Patch5:		rubygems-1.8.5-fix-Gem.latest_load_paths-partial-revert.patch
+# Fix Gem.all_load_paths (although it is deprecated and will be removed
+# on 2011-10-01)
+Patch6:		rubygems-1.8.5-all-load-paths.patch
 
 Requires:	ruby(abi) = 1.8
 Requires:	ruby >= 1.8.7
@@ -52,6 +63,9 @@ libraries.
 %patch0 -p1 -b .noarch
 %patch1 -p1 -b .insync
 %patch3 -p1 -b .rdoc_v
+%patch4 -p1 -b .spec_abort
+%patch5 -p1 -b .patch4
+%patch6 -p1 -b .load_path
 
 # Some of the library files start with #! which rpmlint doesn't like
 # and doesn't make much sense
@@ -107,6 +121,11 @@ mv Rakefile.tmp Rakefile
 %{ruby_sitelib}/ubygems.rb
 
 %changelog
+* Sat Jun 25 2011 Mamoru Tasaka <mtasaka at fedoraproject.org> - 1.8.5-2
+- Fix Gem.latest_load_paths (for rubygem-gettext FTBFS)
+- Fix Gem.all_load_paths (for rubygem-gettext FTBFS, although it is already
+  deprecated from 1.7.0)
+
 * Wed Jun  1 2011 Mamoru Tasaka <mtasaka at fedoraproject.org> - 1.8.5-1
 - Try 1.8.5
 


More information about the scm-commits mailing list