From cd2c821ce7bdba42aae96f6a7c474b31f4d6b880 Mon Sep 17 00:00:00 2001 From: Christopher Thorn Date: Tue, 1 Aug 2023 08:51:53 -0700 Subject: [PATCH] (PA-5666) Fix pl-ruby-patch's filename Starting with Ruby 3.2.2 we want to change the file we are sed'ing. --- configs/components/pl-ruby-patch.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configs/components/pl-ruby-patch.rb b/configs/components/pl-ruby-patch.rb index 8a752fa3b..4a91ced15 100644 --- a/configs/components/pl-ruby-patch.rb +++ b/configs/components/pl-ruby-patch.rb @@ -61,9 +61,16 @@ sed_command = %(s|Gem.ruby.shellsplit|& << '-r/opt/puppetlabs/puppet/share/doc/rbconfig-#{settings[:ruby_version]}-orig.rb'|) end + # rubygems switched which file has the command we need to patch starting with ruby 3.2.2 + if Gem::Version.new(settings[:ruby_version]) >= Gem::Version.new('3.2.2') + filename = 'builder.rb' + else + filename = 'ext_conf_builder.rb' + end + pkg.build do [ - %(#{platform[:sed]} -i "#{sed_command}" #{base_ruby}/rubygems/ext/ext_conf_builder.rb) + %(#{platform[:sed]} -i "#{sed_command}" #{base_ruby}/rubygems/ext/#{filename}) ] end end