]> git.pld-linux.org Git - packages/rpm.git/blob - rpm-5.4.9-ruby1.9-fixes.patch
- rel 45
[packages/rpm.git] / rpm-5.4.9-ruby1.9-fixes.patch
1 diff -urN rpm-5.4.9/macros/ruby.in rpm-5.4.9-patched/macros/ruby.in
2 --- rpm-5.4.9/macros/ruby.in    2011-10-15 23:56:57.000000000 +1100
3 +++ rpm-5.4.9-patched/macros/ruby.in    2012-08-30 18:09:09.732009037 +1100
4 @@ -2,7 +2,7 @@
5  # To make use of these macros insert the following line into your spec file:
6  # %{load:%{_usrlibrpm}/macros.d/ruby}
7  
8 -%__ruby                @__RUBY@
9 +%__ruby                /usr/bin/ruby
10  
11  # Path to scripts to autogenerate php package dependencies,
12  #
13 @@ -11,18 +11,18 @@
14  %__ruby_provides       %{_rpmhome}/rubygems.rb --provides
15  %__ruby_requires       %{_rpmhome}/rubygems.rb --requires
16  
17 -%ruby_version          %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["ruby_version"]')
18 +%ruby_version          %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["ruby_version"]')
19  
20 -%ruby_archdir          %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["archdir"]')
21 -%ruby_libdir           %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["rubylibdir"]')
22 -%ruby_sitedir          %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["sitedir"]')
23 -%ruby_sitearchdir      %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["sitearchdir"]')
24 -%ruby_sitelibdir       %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["sitelibdir"]')
25 -%ruby_vendordir                %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["vendordir"]')
26 -%ruby_vendorarchdir    %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["vendorarchdir"]')
27 -%ruby_vendorlibdir     %(%{__ruby} -rrbconfig -e 'print Config::CONFIG["vendorlibdir"]')
28 -%ruby_gemdir           %(%{__ruby} -rrbconfig -e 'include Config; print CONFIG["rubylibdir"].sub(CONFIG["ruby_version"], "gems/#{CONFIG["ruby_version"]}")')
29 -%ruby_ridir            %(%{__ruby} -rrbconfig -e 'include Config; print File.join(CONFIG["datadir"], "ri", CONFIG["ruby_version"])')
30 +%ruby_archdir          %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["archdir"]')
31 +%ruby_libdir           %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["rubylibdir"]')
32 +%ruby_sitedir          %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["sitedir"]')
33 +%ruby_sitearchdir      %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["sitearchdir"]')
34 +%ruby_sitelibdir       %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["sitelibdir"]')
35 +%ruby_vendordir                %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["vendordir"]')
36 +%ruby_vendorarchdir    %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["vendorarchdir"]')
37 +%ruby_vendorlibdir     %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["vendorlibdir"]')
38 +%ruby_gemdir           %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["rubylibdir"].sub(RbConfig::CONFIG["ruby_version"], "gems/#{RbConfig::CONFIG["ruby_version"]}")')
39 +%ruby_ridir            %(%{__ruby} -rrbconfig -e 'print File.join(RbConfig::CONFIG["datadir"], "ri", RbConfig::CONFIG["ruby_version"])')
40  
41  %__gem_helper %{_usrlibrpm}/gem_helper.rb
42  
43 diff -urN rpm-5.4.9/scripts/gem_helper.rb rpm-5.4.9-patched/scripts/gem_helper.rb
44 --- rpm-5.4.9/scripts/gem_helper.rb     2010-10-16 20:58:48.000000000 +1100
45 +++ rpm-5.4.9-patched/scripts/gem_helper.rb     2012-08-30 18:12:11.233007114 +1100
46 @@ -57,10 +57,13 @@
47      argv.delete_at(0)
48    end
49  
50 -  file_data = Zlib::GzipReader.open("metadata.gz")
51 +  file_data = Zlib::GzipReader.open("metadata.gz") {|io| io.read}
52    header = YAML::load(file_data)
53 -  file_data.close()
54 -  body = header.instance_variable_get :@ivars
55 +  body = {}
56 +  # I don't know any better.. :/
57 +  header.instance_variables.each do |iv|
58 +         body[iv.to_s.gsub(/^@/,'')] = header.instance_variable_get(iv)
59 +  end
60  
61    require 'rubygems'
62    spec = Gem::Specification.from_yaml(YAML.dump(header))
63 diff -urN rpm-5.4.9/scripts/rubygems.rb rpm-5.4.9-patched/scripts/rubygems.rb
64 --- rpm-5.4.9/scripts/rubygems.rb       2011-04-01 18:30:28.000000000 +1100
65 +++ rpm-5.4.9-patched/scripts/rubygems.rb       2012-08-30 18:09:09.771009037 +1100
66 @@ -30,7 +30,7 @@
67    exit(1)
68  end
69  
70 -specpatt = Config::CONFIG["rubylibdir"].sub(Config::CONFIG["ruby_version"], ".*/specifications/.*\.gemspec$")
71 +specpatt = RbConfig::CONFIG["rubylibdir"].sub(RbConfig::CONFIG["ruby_version"], ".*/specifications/.*\.gemspec$")
72  gems = []
73  ruby_versioned = false
74  abi_provide = false
75 @@ -44,17 +44,17 @@
76    # package is dependent on this specific version.
77    # FIXME: only supports current ruby version
78    elsif not ruby_versioned
79 -    if path.match(Config::CONFIG["rubylibdir"])
80 +    if path.match(RbConfig::CONFIG["rubylibdir"])
81        ruby_versioned = true
82        # even more fugly, but we make the assumption that if the package has
83        # this file, the package is the current ruby version, and should
84        # therefore provide ruby(abi) = version
85 -      if provides and path.match(Config::CONFIG["rubylibdir"] + "/Env.rb")
86 +      if provides and path.match(RbConfig::CONFIG["rubylibdir"] + "/Env.rb")
87         abi_provide = true
88        end
89 -    elsif path.match(Config::CONFIG["sitelibdir"])
90 +    elsif path.match(RbConfig::CONFIG["sitelibdir"])
91        ruby_versioned = true
92 -    elsif path.match(Config::CONFIG["vendorlibdir"])
93 +    elsif path.match(RbConfig::CONFIG["vendorlibdir"])
94        ruby_versioned = true
95      end
96    end
97 @@ -63,7 +63,7 @@
98  if requires or abi_provide
99    print "ruby(abi)"
100    if ruby_versioned
101 -    print " = %s\n" % Config::CONFIG["ruby_version"]
102 +    print " = %s\n" % RbConfig::CONFIG["ruby_version"]
103    end
104  end
105  
106 @@ -105,7 +105,7 @@
107      end
108      if requires
109        for d in spec.dependencies
110 -        print d.requirement.to_rpm(d.name) unless d.type != :runtime
111 +        print d.requirement.to_rpm(d.name)[0] unless d.type != :runtime
112        end
113        for d in spec.required_rubygems_version.to_rpm("rubygems")
114          print d.gsub(/(rubygem\()|(\))/, "")
This page took 0.051317 seconds and 3 git commands to generate.