]> git.pld-linux.org Git - packages/rpm.git/commitdiff
gem_helper: add spec-dump to write self contained .gemspec auto/th/rpm-5.4.15-35
authorElan Ruusamäe <glen@delfi.ee>
Wed, 1 Jun 2016 22:20:56 +0000 (01:20 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Wed, 1 Jun 2016 22:20:56 +0000 (01:20 +0300)
gem_helper.rb
rpm.spec

index 2a6bfab756df3a3b22239786c685aaf9899ae2dc..11de3be2fe0faaed59f12916d7d852462a8e791e 100755 (executable)
@@ -8,6 +8,22 @@
 require 'optparse'
 require 'rubygems'
 
+# Write the .gemspec specification (in Ruby)
+def writespec(spec)
+       file_name = spec.full_name.untaint + '.gemspec'
+       File.open(file_name, "w") do |file|
+               file.puts spec.to_ruby_for_cache
+       end
+       print "Wrote: %s\n" % file_name
+end
+
+# make gemspec self-contained
+if ARGV[0] == "spec-dump"
+       spec = eval(File.read(ARGV[1]))
+       writespec(spec)
+       exit(0)
+end
+
 if ARGV[0] == "build" or ARGV[0] == "install" or ARGV[0] == "spec"
   require 'yaml'
   require 'zlib'
@@ -69,12 +85,7 @@ if ARGV[0] == "build" or ARGV[0] == "install" or ARGV[0] == "spec"
   spec = Gem::Specification.from_yaml(YAML.dump(header))
 
   if ARGV[0] == "spec"
-    # Write the .gemspec specification (in Ruby)
-    file_name = spec.full_name.untaint + '.gemspec'
-    File.open(file_name, "w") do |file|
-      file.puts spec.to_ruby_for_cache
-    end
-    print "Wrote: %s\n" % file_name
+    writespec(spec)
     exit(0)
   end
 
index 1c6d227f8bf0938ef1beb79365a1f3ee903e8802..ecdf9d224334c103882e9bdc827a70be4d000063 100644 (file)
--- a/rpm.spec
+++ b/rpm.spec
@@ -51,7 +51,7 @@ Summary(ru.UTF-8):    Менеджер пакетов от RPM
 Summary(uk.UTF-8):     Менеджер пакетів від RPM
 Name:          rpm
 Version:       5.4.15
-Release:       34
+Release:       35
 License:       LGPL v2.1
 Group:         Base
 # http://rpm5.org/files/rpm/rpm-5.4/rpm-5.4.15-0.20140824.src.rpm
This page took 0.529234 seconds and 4 git commands to generate.