]> git.pld-linux.org Git - packages/rpm.git/blob - gem_helper-spec-arg.patch
- make sure that the output buffer gets truncated after use, otherwise
[packages/rpm.git] / gem_helper-spec-arg.patch
1 --- rpm-5.4.10/scripts/gem_helper.rb~   2013-06-21 09:44:47.273773411 +0300
2 +++ rpm-5.4.10/scripts/gem_helper.rb    2013-06-21 09:45:34.619165559 +0300
3 @@ -6,8 +6,9 @@
4  #++
5  
6  require 'optparse'
7 +require 'rubygems'
8  
9 -if ARGV[0] == "build" or ARGV[0] == "install"
10 +if ARGV[0] == "build" or ARGV[0] == "install" or ARGV[0] == "spec"
11    require 'yaml'
12    require 'zlib'
13  
14 @@ -65,9 +66,17 @@
15           body[iv.to_s.gsub(/^@/,'')] = header.instance_variable_get(iv)
16    end
17  
18 -  require 'rubygems'
19    spec = Gem::Specification.from_yaml(YAML.dump(header))
20  
21 +  if ARGV[0] == "spec"
22 +    # Write the .gemspec specification (in Ruby)
23 +    file_name = spec.full_name.untaint + '.gemspec'
24 +    File.open(file_name, "w") do |file|
25 +      file.puts spec.to_ruby_for_cache
26 +    end
27 +    print "Wrote: %s\n" % file_name
28 +  end
29 +
30    if ARGV[0] == "install"
31      system("gem %s %s.gem" % [ARGV.join(' '), spec.full_name])
32      if !keepcache
This page took 0.040425 seconds and 3 git commands to generate.