diff --git a/0001-use-the-ID-from-os-release-to-use-the-proper-templat.patch b/0001-use-the-ID-from-os-release-to-use-the-proper-templat.patch index 6647d9f..d0a1311 100644 --- a/0001-use-the-ID-from-os-release-to-use-the-proper-templat.patch +++ b/0001-use-the-ID-from-os-release-to-use-the-proper-templat.patch @@ -16,7 +16,7 @@ index 736a645..fa7ce6b 100755 template = nil +if template_file.nil? -+ f = open("/etc/os-release", "r") if File.exists?("/etc/os-release") ++ f = open("/etc/os-release", "r") if File.exist?("/etc/os-release") + if f + f.read.split('\n').each do |line| + line.match(%r{^ID=(.*)$}) { |m| template_file=m[1] } diff --git a/0003-new-opensuse-templates.-they-require-the-config-file.patch b/0003-new-opensuse-templates.-they-require-the-config-file.patch index e26dba9..81db53f 100644 --- a/0003-new-opensuse-templates.-they-require-the-config-file.patch +++ b/0003-new-opensuse-templates.-they-require-the-config-file.patch @@ -43,7 +43,7 @@ index 0000000..d1734db + end + + def self.filecontent_or_value(path) -+ (path and File.exists?(path)) ? File.read(path) : path ++ (path and File.exist?(path)) ? File.read(path) : path + end + + def self.parse_custom_pkgs(env_value) diff --git a/0006-Preserve-the-license-header-found-in-the-output-file.patch b/0006-Preserve-the-license-header-found-in-the-output-file.patch index 9c6d4c6..7bab1c8 100644 --- a/0006-Preserve-the-license-header-found-in-the-output-file.patch +++ b/0006-Preserve-the-license-header-found-in-the-output-file.patch @@ -22,7 +22,7 @@ index 7f28603..8a6db05 100755 + Gem2Rpm::convert(gemfile, template, $stdout, nongem, local, doc_subpackage, oldlicense, config) unless deps else begin -+ if File.exists?(output_file) ++ if File.exist?(output_file) + File.open(output_file, 'r') do |oldfile| + oldfile.each_line do |line| + m = line.match(%r{^License:\s*(\w.*)$}) diff --git a/0028-add-binary_map-support.patch b/0028-add-binary_map-support.patch index 962b8c5..c8a6c87 100644 --- a/0028-add-binary_map-support.patch +++ b/0028-add-binary_map-support.patch @@ -37,7 +37,7 @@ index 6add6a7..4861bbd 100644 + end + def self.filecontent_or_value(path) - (path and File.exists?(path)) ? File.read(path) : path + (path and File.exist?(path)) ? File.read(path) : path end @@ -93,6 +100,7 @@ Group: Development/Languages/Ruby <% unless spec.executables.empty? -%> diff --git a/rubygem-gem2rpm.changes b/rubygem-gem2rpm.changes index 6f2ec96..dcd3ada 100644 --- a/rubygem-gem2rpm.changes +++ b/rubygem-gem2rpm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Dec 5 16:25:59 UTC 2022 - Martin Vidner + +- Edit patches to use File.exist? instead of File.exists? which was + removed in Ruby 3.2 + ------------------------------------------------------------------- Thu Nov 17 12:00:27 UTC 2022 - Marcus Rueckert diff --git a/template_loader.patch b/template_loader.patch index e2dad13..d3bd61e 100644 --- a/template_loader.patch +++ b/template_loader.patch @@ -10,5 +10,5 @@ index 45ed21c..c613c12 template = nil +template_file ||= 'opensuse' if template_file.nil? - f = open("/etc/os-release", "r") if File.exists?("/etc/os-release") + f = open("/etc/os-release", "r") if File.exist?("/etc/os-release") if f