Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package rubygem-cheetah for openSUSE:Factory
checked in at 2021-12-03 20:35:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-cheetah (Old)
and /work/SRC/openSUSE:Factory/.rubygem-cheetah.new.31177 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-cheetah"
Fri Dec 3 20:35:22 2021 rev:5 rq:934979 version:1.0.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-cheetah/rubygem-cheetah.changes
2020-01-16 18:13:01.820696152 +0100
+++
/work/SRC/openSUSE:Factory/.rubygem-cheetah.new.31177/rubygem-cheetah.changes
2021-12-03 20:35:27.048211655 +0100
@@ -1,0 +2,12 @@
+Wed Dec 1 12:19:01 UTC 2021 - Josef Reidinger <[email protected]>
+
+- updated to version 1.0.0
+ see installed CHANGELOG
+
+ 1.0.0 (2021-11-30)
+ ------------------
+
+ * Add support for ruby 3.0
+ As side effect now Recorder#record_status receive additional parameter
+
+-------------------------------------------------------------------
@@ -13,2 +24,0 @@
-
-
Old:
----
cheetah-0.5.2.gem
New:
----
cheetah-1.0.0.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-cheetah.spec ++++++
--- /var/tmp/diff_new_pack.gSTPCQ/_old 2021-12-03 20:35:27.540209857 +0100
+++ /var/tmp/diff_new_pack.gSTPCQ/_new 2021-12-03 20:35:27.544209842 +0100
@@ -1,7 +1,7 @@
#
# spec file for package rubygem-cheetah
#
-# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2021 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -24,13 +24,13 @@
#
Name: rubygem-cheetah
-Version: 0.5.2
+Version: 1.0.0
Release: 0
%define mod_name cheetah
%define mod_full_name %{mod_name}-%{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: ruby-macros >= 5
-BuildRequires: %{ruby}
+BuildRequires: %{ruby >= 2.5}
BuildRequires: %{rubygem gem2rpm}
Url: https://github.com/openSUSE/cheetah
Source: https://rubygems.org/gems/%{mod_full_name}.gem
++++++ cheetah-0.5.2.gem -> cheetah-1.0.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/CHANGELOG new/CHANGELOG
--- old/CHANGELOG 2020-01-02 17:40:46.000000000 +0100
+++ new/CHANGELOG 2021-12-01 13:08:44.000000000 +0100
@@ -1,3 +1,9 @@
+1.0.0 (2021-11-30)
+------------------
+
+* Add support for ruby 3.0
+ As side effect now Recorder#record_status receive additional parameter
+
0.5.2 (2020-01-06)
------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/VERSION new/VERSION
--- old/VERSION 2020-01-02 17:40:46.000000000 +0100
+++ new/VERSION 2021-12-01 13:08:44.000000000 +0100
@@ -1 +1 @@
-0.5.2
+1.0.0
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/cheetah/version.rb new/lib/cheetah/version.rb
--- old/lib/cheetah/version.rb 2020-01-02 17:40:46.000000000 +0100
+++ new/lib/cheetah/version.rb 2021-12-01 13:08:44.000000000 +0100
@@ -3,5 +3,5 @@
# Cheetah namespace
module Cheetah
# Cheetah version (uses [semantic versioning](http://semver.org/)).
- VERSION = File.read(File.dirname(__FILE__) + "/../../VERSION").strip
+ VERSION = File.read("#{File.dirname(__FILE__)}/../../VERSION").strip
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/cheetah.rb new/lib/cheetah.rb
--- old/lib/cheetah.rb 2020-01-02 17:40:46.000000000 +0100
+++ new/lib/cheetah.rb 2021-12-01 13:08:44.000000000 +0100
@@ -5,7 +5,7 @@
require "shellwords"
require "stringio"
-require File.expand_path(File.dirname(__FILE__) + "/cheetah/version")
+require File.expand_path("#{File.dirname(__FILE__)}/cheetah/version")
# Your swiss army knife for executing external commands in Ruby safely and
# conveniently.
@@ -121,6 +121,7 @@
#
# @abstract
# @param [Process::Status] status the executed command exit status
+ # @param [Boolean] allowed_status whether the exit code is in the list
of allowed exit codes
abstract_method :record_status
end
@@ -135,7 +136,7 @@
def record_stderr(_stderr); end
- def record_status(_status); end
+ def record_status(_status, _allowed_status); end
end
# A default recorder. It uses the `Logger::INFO` level for normal messages
and
@@ -150,6 +151,8 @@
}.freeze
def initialize(logger)
+ super()
+
@logger = logger
@stream_used = { stdin: false, stdout: false, stderr: false }
@@ -172,19 +175,19 @@
log_stream_increment(:stderr, stderr)
end
- def record_status(status)
+ def record_status(status, allowed_status)
log_stream_remainder(:stdin)
log_stream_remainder(:stdout)
log_stream_remainder(:stderr)
- @logger.send status.success? ? :info : :error,
+ @logger.send allowed_status ? :info : :error,
"Status: #{status.exitstatus}"
end
protected
def format_commands(commands)
- '"' + commands.map { |c| Shellwords.join(c) }.join(" | ") + '"'
+ "\"#{commands.map { |c| Shellwords.join(c) }.join(' | ')}\""
end
def log_stream_increment(stream, data)
@@ -402,14 +405,19 @@
select_loop(streams, pipes, recorder)
_pid, status = Process.wait2(pid)
- # when more exit status are allowed, then redefine success as command
- # not failed (bsc#1153749)
- adapt_status(status, options)
+ # when more exit status are allowed, then pass it below that it did
+ # not fail (bsc#1153749)
+ success = allowed_status?(status, options)
begin
- check_errors(commands, status, streams, streamed)
+ report_errors(commands, status, streams, streamed) if !success
ensure
- recorder.record_status(status)
+ # backward compatibility for recorders with just single parameter
+ if recorder.method(:record_status).arity == 1
+ recorder.record_status(status)
+ else
+ recorder.record_status(status, success)
+ end
end
build_result(streams, status, options)
@@ -417,12 +425,11 @@
private
- def adapt_status(status, options)
- return unless allowed_exitstatus?(options)
+ def allowed_status?(status, options)
+ exit_status = status.exitstatus
+ return exit_status.zero? unless allowed_exitstatus?(options)
- status.define_singleton_method(:success?) do
- options[:allowed_exitstatus].include?(exitstatus)
- end
+ options[:allowed_exitstatus].include?(exit_status)
end
# Parts of Cheetah.run
@@ -519,51 +526,49 @@
def fork_commands_recursive(commands, pipes, options)
fork do
- begin
- # support chrooting
- options = chroot_step(options)
+ # support chrooting
+ options = chroot_step(options)
- if commands.size == 1
- from_pipe(STDIN, pipes[:stdin])
- else
- pipe_to_child = IO.pipe
-
- fork_commands_recursive(commands[0..-2],
- {
- stdin: pipes[:stdin],
- stdout: pipe_to_child,
- stderr: pipes[:stderr]
- },
- options)
+ if commands.size == 1
+ from_pipe($stdin, pipes[:stdin])
+ else
+ pipe_to_child = IO.pipe
- pipes[:stdin][READ].close
- pipes[:stdin][WRITE].close
+ fork_commands_recursive(commands[0..-2],
+ {
+ stdin: pipes[:stdin],
+ stdout: pipe_to_child,
+ stderr: pipes[:stderr]
+ },
+ options)
- from_pipe(STDIN, pipe_to_child)
- end
+ pipes[:stdin][READ].close
+ pipes[:stdin][WRITE].close
- into_pipe(STDOUT, pipes[:stdout])
- into_pipe(STDERR, pipes[:stderr])
+ from_pipe($stdin, pipe_to_child)
+ end
- close_fds
+ into_pipe($stdout, pipes[:stdout])
+ into_pipe($stderr, pipes[:stderr])
- command, *args = commands.last
- with_env(options[:env]) do
- exec([command, command], *args)
- end
- rescue SystemCallError => e
- # depends when failed, if pipe is already redirected or not, so lets
find it
- output = pipes[:stderr][WRITE].closed? ? STDERR :
pipes[:stderr][WRITE]
- output.puts e.message
+ close_fds
- exit!(127)
+ command, *args = commands.last
+ with_env(options[:env]) do
+ exec([command, command], *args)
end
+ rescue SystemCallError => e
+ # depends when failed, if pipe is already redirected or not, so lets
find it
+ output = pipes[:stderr][WRITE].closed? ? $stderr :
pipes[:stderr][WRITE]
+ output.puts e.message
+
+ exit!(127)
end
end
# closes all open fds starting with 3 and above
def close_fds
- # note: this will work only if unix has /proc filesystem. If it does not
+ # NOTE: this will work only if unix has /proc filesystem. If it does not
# have it, it won't close other fds.
Dir.glob("/proc/self/fd/*").each do |path|
fd = File.basename(path).to_i
@@ -655,7 +660,7 @@
end
end
- def check_errors(commands, status, streams, streamed)
+ def report_errors(commands, status, streams, streamed)
return if status.success?
stderr_part = if streamed[:stderr]
@@ -664,7 +669,7 @@
" (no error output)"
else
lines = streams[:stderr].string.split("\n")
- ": " + lines.first + (lines.size > 1 ? " (...)" : "")
+ ": #{lines.first}#{lines.size > 1 ? ' (...)' : ''}"
end
raise ExecutionFailed.new(
@@ -707,7 +712,7 @@
end
def format_commands(commands)
- '"' + commands.map { |c| Shellwords.join(c) }.join(" | ") + '"'
+ "\"#{commands.map { |c| Shellwords.join(c) }.join(' | ')}\""
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2020-01-06 13:02:25.000000000 +0100
+++ new/metadata 2021-12-01 13:12:56.000000000 +0100
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: cheetah
version: !ruby/object:Gem::Version
- version: 0.5.2
+ version: 1.0.0
platform: ruby
authors:
- David Majda
autorequire:
bindir: bin
cert_chain: []
-date: 2020-01-06 00:00:00.000000000 Z
+date: 2021-12-01 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: abstract_method
@@ -77,7 +77,7 @@
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: '0'
+ version: '2.5'
required_rubygems_version: !ruby/object:Gem::Requirement
requirements:
- - ">="
@@ -85,7 +85,7 @@
version: '0'
requirements: []
rubyforge_project:
-rubygems_version: 2.7.6.2
+rubygems_version: 2.7.6.3
signing_key:
specification_version: 4
summary: Your swiss army knife for executing external commands in Ruby safely
and