[packages/rpm-pld-macros] 2.054; try to be compatible with existing macro usage
arekm
arekm at pld-linux.org
Mon Mar 16 18:57:58 CET 2026
commit 401727e47dad282f7dba0a703fa4891315302ef9
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Mon Mar 16 18:57:39 2026 +0100
2.054; try to be compatible with existing macro usage
gem_helper.rb | 13 +++++++++++--
rpm-pld-macros.spec | 2 +-
2 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/rpm-pld-macros.spec b/rpm-pld-macros.spec
index 321b454..0f3c595 100644
--- a/rpm-pld-macros.spec
+++ b/rpm-pld-macros.spec
@@ -1,4 +1,4 @@
-%define rpm_macros_rev 2.053
+%define rpm_macros_rev 2.054
%define find_lang_rev 1.42
# split into individual X_prov_ver if there is a reason to desync
%define prov_ver 4.15
diff --git a/gem_helper.rb b/gem_helper.rb
index 56b09e2..a9fd7de 100755
--- a/gem_helper.rb
+++ b/gem_helper.rb
@@ -27,6 +27,7 @@ end
if ARGV[0] == "build" or ARGV[0] == "install" or ARGV[0] == "spec"
require 'yaml'
require 'zlib'
+ require 'rubygems/package'
filter = nil
opts = nil
@@ -74,8 +75,16 @@ if ARGV[0] == "build" or ARGV[0] == "install" or ARGV[0] == "spec"
argv.delete_at(0)
end
- file_data = Zlib::GzipReader.open("metadata.gz") {|io| io.read}
- spec = Gem::Specification.from_yaml(file_data)
+ if File.exist?("metadata.gz")
+ file_data = Zlib::GzipReader.open("metadata.gz") {|io| io.read}
+ spec = Gem::Specification.from_yaml(file_data)
+ elsif File.exist?("metadata")
+ spec = Gem::Specification.from_yaml(File.read("metadata"))
+ elsif (gemspec = (Dir["*.gemspec"] + Dir[File.join(File.dirname(Dir.pwd), "*.gemspec")]).first)
+ spec = Gem::Specification.load(gemspec)
+ else
+ raise "No metadata.gz, metadata, or .gemspec found"
+ end
body = {}
spec.instance_variables.each do |iv|
body[iv.to_s.sub(/^@/,'')] = spec.instance_variable_get(iv)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/rpm-pld-macros.git/commitdiff/401727e47dad282f7dba0a703fa4891315302ef9
More information about the pld-cvs-commit
mailing list