Hello community,

here is the log from the commit of package catatonit for openSUSE:Factory 
checked in at 2020-03-05 23:17:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/catatonit (Old)
 and      /work/SRC/openSUSE:Factory/.catatonit.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "catatonit"

Thu Mar  5 23:17:23 2020 rev:6 rq:781017 version:0.1.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/catatonit/catatonit.changes      2019-02-08 
12:06:25.269626453 +0100
+++ /work/SRC/openSUSE:Factory/.catatonit.new.26092/catatonit.changes   
2020-03-05 23:17:31.481151542 +0100
@@ -1,0 +2,6 @@
+Mon Mar  2 16:20:29 UTC 2020 - Aleksa Sarai <[email protected]>
+
+- Update to catatonit v0.1.5, which fixes two bugs where catatonit would hang
+  endlessly when pid1 died in very specific ways.
+
+-------------------------------------------------------------------
@@ -4 +10 @@
-- Update to catatonit v0.1.4, which include support for "-g".
+- Update to catatonit v0.1.4, which includes support for "-g".

Old:
----
  _service
  catatonit-0.1.4.tar.xz
  catatonit-0.1.4.tar.xz.asc

New:
----
  catatonit-0.1.5.tar.xz
  catatonit-0.1.5.tar.xz.asc

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ catatonit.spec ++++++
--- /var/tmp/diff_new_pack.xkHggO/_old  2020-03-05 23:17:31.965151817 +0100
+++ /var/tmp/diff_new_pack.xkHggO/_new  2020-03-05 23:17:31.969151818 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package catatonit
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,14 +17,14 @@
 
 
 Name:           catatonit
-Version:        0.1.4
+Version:        0.1.5
 Release:        0
 Summary:        A signal-forwarding process manager for containers
 License:        GPL-3.0-or-later
 Group:          System/Management
-Url:            https://github.com/openSUSE/catatonit
-Source0:        %{name}-%{version}.tar.xz
-Source1:        %{name}-%{version}.tar.xz.asc
+URL:            https://github.com/openSUSE/catatonit
+Source0:        
https://github.com/openSUSE/catatonit/releases/download/v%{version}/%{name}.tar.xz#/%{name}-%{version}.tar.xz
+Source1:        
https://github.com/openSUSE/catatonit/releases/download/v%{version}/%{name}.tar.xz.asc#/%{name}-%{version}.tar.xz.asc
 Source2:        %{name}.keyring
 Source3:        %{name}-rpmlintrc
 BuildRequires:  autoconf

++++++ catatonit-0.1.4.tar.xz -> catatonit-0.1.5.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/catatonit-0.1.4/.gitignore 
new/catatonit-0.1.5/.gitignore
--- old/catatonit-0.1.4/.gitignore      2019-01-29 08:28:39.000000000 +0100
+++ new/catatonit-0.1.5/.gitignore      2020-03-02 17:11:24.000000000 +0100
@@ -1,6 +1,6 @@
 # Our binary.
 /catatonit
-/VERSION
+/release/
 
 # Autoconf generated files for binaries.
 /Makefile
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/catatonit-0.1.4/.lgtm new/catatonit-0.1.5/.lgtm
--- old/catatonit-0.1.4/.lgtm   1970-01-01 01:00:00.000000000 +0100
+++ new/catatonit-0.1.5/.lgtm   2020-03-02 17:11:24.000000000 +0100
@@ -0,0 +1,2 @@
+approvals = 1
+pattern = "^LGTM"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/catatonit-0.1.4/MAINTAINERS 
new/catatonit-0.1.5/MAINTAINERS
--- old/catatonit-0.1.4/MAINTAINERS     1970-01-01 01:00:00.000000000 +0100
+++ new/catatonit-0.1.5/MAINTAINERS     2020-03-02 17:11:24.000000000 +0100
@@ -0,0 +1 @@
+Aleksa Sarai <[email protected]> (@cyphar)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/catatonit-0.1.4/VERSION.in 
new/catatonit-0.1.5/VERSION.in
--- old/catatonit-0.1.4/VERSION.in      2019-01-29 08:28:39.000000000 +0100
+++ new/catatonit-0.1.5/VERSION.in      1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-@PACKAGE_VERSION@
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/catatonit-0.1.4/autogen.sh 
new/catatonit-0.1.5/autogen.sh
--- old/catatonit-0.1.4/autogen.sh      1970-01-01 01:00:00.000000000 +0100
+++ new/catatonit-0.1.5/autogen.sh      2020-03-02 17:11:24.000000000 +0100
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec autoreconf -fiv
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/catatonit-0.1.4/catatonit.c 
new/catatonit-0.1.5/catatonit.c
--- old/catatonit-0.1.4/catatonit.c     2019-01-29 08:28:39.000000000 +0100
+++ new/catatonit-0.1.5/catatonit.c     2020-03-02 17:11:24.000000000 +0100
@@ -222,10 +222,11 @@
  * continually wait for child process deaths until none are reported (or we
  * have no children left).
  */
-static int reap_zombies(void)
+static int reap_zombies(pid_t pid1, int *pid1_exitcode)
 {
        for (;;) {
                int wstatus = 0;
+
                pid_t child = waitpid(-1, &wstatus, WNOHANG);
                if (child <= 0) {
                        if (errno == ECHILD) {
@@ -234,6 +235,28 @@
                        }
                        return child;
                }
+
+               /*
+                * There is a special-case for our pid1. If the process exits we
+                * inherit its exit code, otherwise we assume an exit code of 
127.
+                * This will cause us to exit immediately, since pid1 is now 
dead.
+                */
+               if (child == pid1) {
+                       /* Did it die from an exit(2)? */
+                       if (WIFEXITED(wstatus))
+                               *pid1_exitcode = WEXITSTATUS(wstatus);
+                       /* What about from a signal? */
+                       else if (WIFSIGNALED(wstatus))
+                               *pid1_exitcode = 128 + WTERMSIG(wstatus);
+                       /* Is the child actually dead? */
+                       else if (kill(pid1, 0) < 0)
+                               *pid1_exitcode = 127;
+                       /* It hasn't died... */
+                       else
+                               warn("received SIGCHLD from pid1 (%d) but it's 
still alive", pid1);
+                       continue;
+               }
+
                if (WIFEXITED(wstatus))
                        debug("child process %d exited with code %d", child, 
WEXITSTATUS(wstatus));
                else if (WIFSIGNALED(wstatus))
@@ -382,26 +405,7 @@
                 * you'd ever want that, but no reason to not support it.
                 */
                case SIGCHLD:
-                       /*
-                        * There is a special-case for our pid1. If the process 
exits we
-                        * inherit its exit code, otherwise we assume an exit 
code of 127.
-                        * This will cause us to exit immediately, since pid1 
is now dead.
-                        */
-                       if (ssi.ssi_pid == pid1) {
-                               /* Did it die from an exit(2)? */
-                               if (WIFEXITED(ssi.ssi_status))
-                                       pid1_exitcode = 
WEXITSTATUS(ssi.ssi_status);
-                               /* What about from a signal? */
-                               else if (WIFSIGNALED(ssi.ssi_status))
-                                       pid1_exitcode = 128 + 
WTERMSIG(ssi.ssi_status);
-                               /* Is the child actually dead? */
-                               else if (kill(pid1, 0) < 0)
-                                       pid1_exitcode = 127;
-                               /* It hasn't died... */
-                               else
-                                       warn("received SIGCHLD from pid1 (%d) 
but it's still alive", pid1);
-                       }
-                       if (reap_zombies() < 0)
+                       if (reap_zombies(pid1, &pid1_exitcode) < 0)
                                warn("problem occurred while reaping zombies: 
%m");
                        break;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/catatonit-0.1.4/configure.ac 
new/catatonit-0.1.5/configure.ac
--- old/catatonit-0.1.4/configure.ac    2019-01-29 08:28:39.000000000 +0100
+++ new/catatonit-0.1.5/configure.ac    2020-03-02 17:11:24.000000000 +0100
@@ -15,7 +15,7 @@
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 AC_PREREQ([2.69])
-AC_INIT([catatonit], [0.1.4], [https://bugs.opensuse.org/], [], 
[https://github.com/openSUSE/catatonit/])
+AC_INIT([catatonit], [0.1.5], [https://bugs.opensuse.org/], [], 
[https://github.com/openSUSE/catatonit/])
 AM_INIT_AUTOMAKE([-Wall foreign])
 
 LT_PREREQ([2.4.2])
@@ -27,6 +27,6 @@
 AC_TYPE_PID_T
 AC_FUNC_FORK
 
-AC_CONFIG_FILES([Makefile config.h VERSION])
+AC_CONFIG_FILES([Makefile config.h])
 AC_OUTPUT
 AM_INIT_AUTOMAKE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/catatonit-0.1.4/hack/release.sh 
new/catatonit-0.1.5/hack/release.sh
--- old/catatonit-0.1.4/hack/release.sh 2019-01-29 08:28:39.000000000 +0100
+++ new/catatonit-0.1.5/hack/release.sh 2020-03-02 17:11:24.000000000 +0100
@@ -1,19 +1,12 @@
 #!/bin/bash
-# Copyright (C) 2017, 2018 SUSE LLC.
+# release.sh: configurable signed-artefact release script
+# Copyright (C) 2016-2019 SUSE LLC.
 #
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-set -e
+set -Eeuo pipefail
 
 ## --->
 # Project-specific options and functions. In *theory* you shouldn't need to
@@ -21,32 +14,48 @@
 project="catatonit"
 root="$(readlink -f "$(dirname "${BASH_SOURCE}")/..")"
 
+# Make pushd and popd silent.
+function pushd() { command pushd "$@" &>/dev/null ; }
+function  popd() { command  popd "$@" &>/dev/null ; }
+
+# These functions allow you to configure how the defaults are computed.
+function get_arch()    { uname -m ; }
+function get_version() { echo '@PACKAGE_VERSION@' | "$root/config.status" 
--file - ; }
+
+# Any pre-configuration steps should be done here -- for instance ./configure.
+function setup_project() {
+       pushd "$root"
+       ./autogen.sh
+       ./configure LDFLAGS="-static" --prefix=/ --bindir=/bin
+       popd
+}
+
 # This function takes an output path as an argument, where the built
 # (preferably static) binary should be placed.
 function build_project() {
-       builddir="$(dirname "$1")"
+       tmprootfs="$(mktemp -d --tmpdir "$project-build.XXXXXX")"
 
-       ( cd "$root" ; autoreconf -fi ; ./configure; make )
-       strip "./$project"
-       mv "./$project" "$1"
-}
+       make -C "$root" clean all install DESTDIR="$tmprootfs"
 
+       mv "$tmprootfs/bin/$project" "$1"
+       rm -rf "$tmprootfs"
+}
 # End of the easy-to-configure portion.
 ## <---
 
 # Print usage information.
 function usage() {
-       echo "usage: release.sh [-S <gpg-key-id>] [-c <commit-ish>] [-r 
<release-dir>] [-v <version>]" >&2
-       exit 1
+       echo "usage: release.sh [-h] [-v <version>] [-c <commit>] [-o 
<output-dir>]" >&2
+       echo "                       [-H <hashcmd>] [-S <gpg-key>]" >&2
 }
 
 # Log something to stderr.
 function log() {
-       echo "[*] $*" >&2
+       echo "[*]" "$@" >&2
 }
 
 # Log something to stderr and then exit with 0.
-function bail() {
+function quit() {
        log "$@"
        exit 0
 }
@@ -57,14 +66,14 @@
        gpg "$@" --clear-sign </dev/null >/dev/null
 }
 
-# When creating releases we need to build static binaries, an archive of the
-# current commit, and generate detached signatures for both.
+# When creating releases we need to build (ideally static) binaries, an archive
+# of the current commit, and generate detached signatures for both.
 keyid=""
-commit="HEAD"
 version=""
-releasedir=""
-hashcmd=""
-while getopts "S:c:r:v:h:" opt; do
+arch=""
+commit="HEAD"
+hashcmd="sha256sum"
+while getopts ":h:v:c:o:S:H:" opt; do
        case "$opt" in
                S)
                        keyid="$OPTARG"
@@ -72,59 +81,68 @@
                c)
                        commit="$OPTARG"
                        ;;
-               r)
-                       releasedir="$OPTARG"
+               o)
+                       outputdir="$OPTARG"
                        ;;
                v)
                        version="$OPTARG"
                        ;;
-               h)
+               H)
                        hashcmd="$OPTARG"
                        ;;
+               h)
+                       usage ; exit 0
+                       ;;
                \:)
                        echo "Missing argument: -$OPTARG" >&2
-                       usage
+                       usage ; exit 1
                        ;;
                \?)
                        echo "Invalid option: -$OPTARG" >&2
-                       usage
+                       usage ; exit 1
                        ;;
        esac
 done
 
-version="${version:-$(<"$root/VERSION")}"
-releasedir="${releasedir:-release/$version}"
-hashcmd="${hashcmd:-sha256sum}"
-arch="$(uname -m)"
-
-log "creating $project release in '$releasedir'"
-log "  version: $version"
-log "   commit: $commit"
-log "      key: ${keyid:-DEFAULT}"
-log "     hash: $hashcmd"
+# Run project setup first...
+( set -x ; setup_project )
+
+# Generate the defaults for version and so on *after* argument parsing and
+# setup_project, to avoid calling get_version() needlessly.
+version="${version:-$(get_version)}"
+arch="${arch:-$(get_arch)}"
+outputdir="${outputdir:-release/$version}"
+
+log "[[ $project ]]"
+log "version: $version"
+log "commit: $commit"
+log "output_dir: $outputdir"
+log "key: ${keyid:-(default)}"
+log "hash_cmd: $hashcmd"
 
 # Make explicit what we're doing.
 set -x
 
 # Make the release directory.
-rm -rf "$releasedir" && mkdir -p "$releasedir"
+rm -rf "$outputdir" && mkdir -p "$outputdir"
 
 # Build project.
-build_project "$releasedir/$project.$arch"
+build_project "$outputdir/$project.$arch"
 
 # Generate new archive.
-git archive --format=tar --prefix="$project-$version/" "$commit" | xz > 
"$releasedir/$project.tar.xz"
+git archive --format=tar --prefix="$project-$version/" "$commit" | xz > 
"$outputdir/$project.tar.xz"
 
 # Generate sha256 checksums for both.
-( cd "$releasedir" ; "$hashcmd" "$project".{"$arch",tar.xz} > 
"$project.$hashcmd" ; )
+( cd "$outputdir" ; "$hashcmd" "$project".{"$arch",tar.xz} > 
"$project.$hashcmd" ; )
 
 # Set up the gpgflags.
-[[ "$keyid" ]] && export gpgflags="--default-key $keyid"
-gpg_cansign $gpgflags || bail "Could not find suitable GPG key, skipping 
signing step."
+gpgflags=()
+[[ -z "$keyid" ]] || gpgflags+=("--default-key=$keyid")
+gpg_cansign "${gpgflags[@]}" || quit "Could not find suitable GPG key, 
skipping signing step."
 
 # Sign everything.
-gpg $gpgflags --detach-sign --armor "$releasedir/$project.$arch"
-gpg $gpgflags --detach-sign --armor "$releasedir/$project.tar.xz"
-gpg $gpgflags --clear-sign --armor \
-       --output "$releasedir/$project.$hashcmd"{.tmp,} && \
-       mv "$releasedir/$project.$hashcmd"{.tmp,}
+gpg "${gpgflags[@]}" --detach-sign --armor "$outputdir/$project.$arch"
+gpg "${gpgflags[@]}" --detach-sign --armor "$outputdir/$project.tar.xz"
+gpg "${gpgflags[@]}" --clear-sign --armor \
+       --output "$outputdir/$project.$hashcmd"{.tmp,} && \
+       mv "$outputdir/$project.$hashcmd"{.tmp,}


Reply via email to