rpm/rpm-5.4.4-ruby1.9-fixes.patch
2012-03-08 04:55:15 +04:00

107 lines
5.2 KiB
Diff

--- rpm-5.4.4/macros/ruby.in.ruby19~ 2012-02-12 02:12:46.836859413 +0100
+++ rpm-5.4.4/macros/ruby.in 2012-02-12 02:15:46.629035339 +0100
@@ -2,7 +2,7 @@
# To make use of these macros insert the following line into your spec file:
# %{load:%{_usrlibrpm}/macros.d/ruby}
-%__ruby @__RUBY@
+%__ruby /usr/bin/ruby
# Path to scripts to autogenerate php package dependencies,
#
@@ -11,18 +11,18 @@
%__ruby_provides %{_rpmhome}/rubygems.rb --provides
%__ruby_requires %{_rpmhome}/rubygems.rb --requires
-%ruby_version %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["ruby_version"]')
+%ruby_version %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["ruby_version"]')
-%ruby_archdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["archdir"]')
-%ruby_libdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["rubylibdir"]')
-%ruby_sitedir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["sitedir"]')
-%ruby_sitearchdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["sitearchdir"]')
-%ruby_sitelibdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["sitelibdir"]')
-%ruby_vendordir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["vendordir"]')
-%ruby_vendorarchdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["vendorarchdir"]')
-%ruby_vendorlibdir %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["vendorlibdir"]')
-%ruby_gemdir %(%{__ruby} -rrbconfig -e 'include Config; print CONFIG["rubylibdir"].sub(CONFIG["ruby_version"], "gems/#{CONFIG["ruby_version"]}")')
-%ruby_ridir %(%{__ruby} -rrbconfig -e 'include Config; print File.join(CONFIG["datadir"], "ri", CONFIG["ruby_version"])')
+%ruby_archdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["archdir"]')
+%ruby_libdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["rubylibdir"]')
+%ruby_sitedir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["sitedir"]')
+%ruby_sitearchdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["sitearchdir"]')
+%ruby_sitelibdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["sitelibdir"]')
+%ruby_vendordir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["vendordir"]')
+%ruby_vendorarchdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["vendorarchdir"]')
+%ruby_vendorlibdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["vendorlibdir"]')
+%ruby_gemdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["rubylibdir"].sub(RbConfig::CONFIG["ruby_version"], "gems/#{RbConfig::CONFIG["ruby_version"]}")')
+%ruby_ridir %(%{__ruby} -rrbconfig -e 'print File.join(RbConfig::CONFIG["datadir"], "ri", RbConfig::CONFIG["ruby_version"])')
%__gem_helper %{_usrlibrpm}/gem_helper.rb
--- rpm-5.4.4/scripts/gem_helper.rb.ruby19~ 2012-02-10 18:11:51.651949530 +0100
+++ rpm-5.4.4/scripts/gem_helper.rb 2012-02-12 02:09:01.918636768 +0100
@@ -60,7 +60,11 @@ if ARGV[0] == "build" or ARGV[0] == "ins
file_data = Zlib::GzipReader.open("metadata.gz")
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))
--- rpm-5.4.4/scripts/rubygems.rb.ruby19~ 2012-02-10 18:13:31.677929922 +0100
+++ rpm-5.4.4/scripts/rubygems.rb 2012-02-10 18:29:59.496622154 +0100
@@ -30,7 +30,7 @@ if rest.size != 0 or (!provides and !req
exit(1)
end
-specpatt = Config::CONFIG["rubylibdir"].sub(Config::CONFIG["ruby_version"], ".*/specifications/.*\.gemspec$")
+specpatt = RbConfig::CONFIG["rubylibdir"].sub(RbConfig::CONFIG["ruby_version"], ".*/specifications/.*\.gemspec$")
gems = []
ruby_versioned = false
abi_provide = false
@@ -44,17 +44,17 @@ for path in $stdin.readlines
# package is dependent on this specific version.
# FIXME: only supports current ruby version
elsif not ruby_versioned
- if path.match(Config::CONFIG["rubylibdir"])
+ if path.match(RbConfig::CONFIG["rubylibdir"])
ruby_versioned = true
# even more fugly, but we make the assumption that if the package has
# this file, the package is the current ruby version, and should
# therefore provide ruby(abi) = version
- if provides and path.match(Config::CONFIG["rubylibdir"] + "/Env.rb")
+ if provides and path.match(RbConfig::CONFIG["rubylibdir"] + "/Env.rb")
abi_provide = true
end
- elsif path.match(Config::CONFIG["sitelibdir"])
+ elsif path.match(RbConfig::CONFIG["sitelibdir"])
ruby_versioned = true
- elsif path.match(Config::CONFIG["vendorlibdir"])
+ elsif path.match(RbConfig::CONFIG["vendorlibdir"])
ruby_versioned = true
end
end
@@ -63,7 +63,7 @@ end
if requires or abi_provide
print "ruby(abi)"
if ruby_versioned
- print " = %s\n" % Config::CONFIG["ruby_version"]
+ print " = %s\n" % RbConfig::CONFIG["ruby_version"]
end
end
@@ -105,7 +105,7 @@ if gems.length > 0
end
if requires
for d in spec.dependencies
- print d.requirement.to_rpm(d.name) unless d.type != :runtime
+ print d.requirement.to_rpm(d.name)[0] unless d.type != :runtime
end
for d in spec.required_rubygems_version.to_rpm("rubygems")
print d.gsub(/(rubygem\()|(\))/, "")