[packages/rpm-pld-macros] Up to 2.053; try to make this working on ruby 3.2+ (needs review; btw. other distros dropped gem_hel

arekm arekm at pld-linux.org
Mon Mar 16 18:38:56 CET 2026


commit 7a6ca85ca49f6dc8f9f0f1aa46b3dc4e41e0916f
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Mon Mar 16 18:38:45 2026 +0100

    Up to 2.053; try to make this working on ruby 3.2+ (needs review; btw. other distros dropped gem_helper.rb approach)

 gem_helper.rb       | 15 ++++++---------
 rpm-pld-macros.spec |  2 +-
 2 files changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/rpm-pld-macros.spec b/rpm-pld-macros.spec
index 3db2f20..321b454 100644
--- a/rpm-pld-macros.spec
+++ b/rpm-pld-macros.spec
@@ -1,4 +1,4 @@
-%define		rpm_macros_rev	2.052
+%define		rpm_macros_rev	2.053
 %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 3a82737..56b09e2 100755
--- a/gem_helper.rb
+++ b/gem_helper.rb
@@ -10,7 +10,7 @@ require 'rubygems'
 
 # Write the .gemspec specification (in Ruby)
 def writespec(spec)
-	file_name = spec.full_name.untaint + '.gemspec'
+	file_name = spec.full_name + '.gemspec'
 	File.open(file_name, "w") do |file|
 		file.puts spec.to_ruby_for_cache
 	end
@@ -75,15 +75,12 @@ if ARGV[0] == "build" or ARGV[0] == "install" or ARGV[0] == "spec"
   end
 
   file_data = Zlib::GzipReader.open("metadata.gz") {|io| io.read}
-  header = YAML::load(file_data)
+  spec = Gem::Specification.from_yaml(file_data)
   body = {}
-  # I don't know any better.. :/
-  header.instance_variables.each do |iv|
-	  body[iv.to_s.sub(/^@/,'')] = header.instance_variable_get(iv)
+  spec.instance_variables.each do |iv|
+	  body[iv.to_s.sub(/^@/,'')] = spec.instance_variable_get(iv)
   end
 
-  spec = Gem::Specification.from_yaml(YAML.dump(header))
-
   if ARGV[0] == "spec"
     writespec(spec)
     exit(0)
@@ -186,9 +183,9 @@ if ARGV[0] == "build" or ARGV[0] == "install" or ARGV[0] == "spec"
       end
     end
 
-    spec = Gem::Specification.from_yaml(YAML.dump(header))
+    require 'rubygems/package'
     unless dry_run
-      Gem::Builder.new(spec).build
+      Gem::Package.build(spec)
     else
       files.concat(spec.files)
       print "%s\n" % files.join("\n")
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm-pld-macros.git/commitdiff/7a6ca85ca49f6dc8f9f0f1aa46b3dc4e41e0916f



More information about the pld-cvs-commit mailing list