1
0

Accepting request 1040596 from home:mvidner:branches:devel:languages:ruby

- Edit patches to use File.exist? instead of File.exists? which was
  removed in Ruby 3.2

Maybe I should instead make a PR to https://github.com/openSUSE/gem2rpm/commits/master ? But I'm confused by this package using that repo only up to 2019-02.

OBS-URL: https://build.opensuse.org/request/show/1040596
OBS-URL: https://build.opensuse.org/package/show/devel:languages:ruby/rubygem-gem2rpm?expand=0&rev=45
This commit is contained in:
Marcus Rückert 2022-12-06 10:54:13 +00:00 committed by Git OBS Bridge
parent f91393272b
commit 835a5c15e7
6 changed files with 11 additions and 5 deletions

View File

@ -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] }

View File

@ -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)

View File

@ -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.*)$})

View File

@ -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? -%>

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Dec 5 16:25:59 UTC 2022 - Martin Vidner <mvidner@suse.com>
- 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 <mrueckert@suse.de>

View File

@ -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