[packages/rpm: 3/4] merge rpm-5.4.9-ruby1.9-fixes.patch into gem_helper.rb

glen glen at pld-linux.org
Thu Dec 18 20:17:36 CET 2014


commit 070ae9e22add0476e348402f3818398744d57fde
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Thu Dec 18 21:12:37 2014 +0200

    merge rpm-5.4.9-ruby1.9-fixes.patch into gem_helper.rb

 gem_helper.rb                 |  9 ++++++---
 rpm-5.4.9-ruby1.9-fixes.patch | 20 --------------------
 2 files changed, 6 insertions(+), 23 deletions(-)
---
diff --git a/gem_helper.rb b/gem_helper.rb
index 65f45e4..feea121 100755
--- a/gem_helper.rb
+++ b/gem_helper.rb
@@ -58,10 +58,13 @@ if ARGV[0] == "build" or ARGV[0] == "install" or ARGV[0] == "spec"
     argv.delete_at(0)
   end
 
-  file_data = Zlib::GzipReader.open("metadata.gz")
+  file_data = Zlib::GzipReader.open("metadata.gz") {|io| io.read}
   header = YAML::load(file_data)
-  file_data.close()
-  body = header.instance_variable_get :@ivars
+  body = {}
+  # I don't know any better.. :/
+  header.instance_variables.each do |iv|
+	  body[iv.to_s.gsub(/^@/,'')] = header.instance_variable_get(iv)
+  end
 
   spec = Gem::Specification.from_yaml(YAML.dump(header))
 
diff --git a/rpm-5.4.9-ruby1.9-fixes.patch b/rpm-5.4.9-ruby1.9-fixes.patch
index b6e24af..07748fd 100644
--- a/rpm-5.4.9-ruby1.9-fixes.patch
+++ b/rpm-5.4.9-ruby1.9-fixes.patch
@@ -40,23 +40,3 @@ diff -urN rpm-5.4.9/macros/ruby.in rpm-5.4.9-patched/macros/ruby.in
  
  %__gem_helper %{_usrlibrpm}/gem_helper.rb
  
-diff -urN rpm-5.4.9/scripts/gem_helper.rb rpm-5.4.9-patched/scripts/gem_helper.rb
---- rpm-5.4.9/scripts/gem_helper.rb	2010-10-16 20:58:48.000000000 +1100
-+++ rpm-5.4.9-patched/scripts/gem_helper.rb	2012-08-30 18:12:11.233007114 +1100
-@@ -57,10 +57,13 @@
-     argv.delete_at(0)
-   end
- 
--  file_data = Zlib::GzipReader.open("metadata.gz")
-+  file_data = Zlib::GzipReader.open("metadata.gz") {|io| io.read}
-   header = YAML::load(file_data)
--  file_data.close()
--  body = header.instance_variable_get :@ivars
-+  body = {}
-+  # I don't know any better.. :/
-+  header.instance_variables.each do |iv|
-+	  body[iv.to_s.gsub(/^@/,'')] = header.instance_variable_get(iv)
-+  end
- 
-   require 'rubygems'
-   spec = Gem::Specification.from_yaml(YAML.dump(header))
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm.git/commitdiff/cffc13fad6e80c8609fe8a53e372acacaef98d41



More information about the pld-cvs-commit mailing list