diff --git a/BZ-1967686-do-not-error-out-on-SIGINT.patch b/BZ-1967686-do-not-error-out-on-SIGINT.patch new file mode 100644 index 0000000000000000000000000000000000000000..3a076eb0b060ae70f6cd4a43593d039de3d36dfd --- /dev/null +++ b/BZ-1967686-do-not-error-out-on-SIGINT.patch @@ -0,0 +1,61 @@ +From 9147d3b66e0a263c2eb427b7892b34c925363854 Mon Sep 17 00:00:00 2001 +From: Michal Domonkos +Date: Thu, 17 Feb 2022 17:36:00 +0100 +Subject: [PATCH] Don't error out when command receives SIGINT + +Interrupting a running command isn't really an execution problem so +don't print an error or return a non-zero exit status. + +This is also how it worked in versions older than 2.0. + +Resolves: rhbz#1967686 +--- + src/fallback.c | 3 +++ + src/scllib.c | 3 +++ + 2 files changed, 6 insertions(+) + +diff --git a/src/fallback.c b/src/fallback.c +index 4b9c8fd..c907a34 100644 +--- a/src/fallback.c ++++ b/src/fallback.c +@@ -6,6 +6,7 @@ + #include + #include + #include ++#include + + #include "scllib.h" + #include "sclmalloc.h" +@@ -229,6 +230,8 @@ scl_rc fallback_run_command(char * const colnames[], const char *cmd, bool exec) + xasprintf(&bash_cmd, "/bin/bash %s", tmp); + status = system(bash_cmd); + if (status == -1 || !WIFEXITED(status)) { ++ if (WIFSIGNALED(status) && WTERMSIG(status) == SIGINT) ++ goto exit; + debug("Problem with executing command \"%s\"\n", bash_cmd); + ret = ERUN; + goto exit; +diff --git a/src/scllib.c b/src/scllib.c +index a182194..2ba8df8 100644 +--- a/src/scllib.c ++++ b/src/scllib.c +@@ -11,6 +11,7 @@ + #include + #include + #include ++#include + + #include "config.h" + #include "errors.h" +@@ -341,6 +342,8 @@ scl_rc run_command(char * const colnames[], const char *cmd, bool exec) + + status = system(cmd); + if (status == -1 || !WIFEXITED(status)) { ++ if (WIFSIGNALED(status) && WTERMSIG(status) == SIGINT) ++ goto exit; + debug("Problem with executing program \"%s\"\n", cmd); + ret = ERUN; + goto exit; +-- +2.35.1 + diff --git a/download b/download new file mode 100644 index 0000000000000000000000000000000000000000..f58d80d18034d40034736ff893872a9294fdbb25 --- /dev/null +++ b/download @@ -0,0 +1 @@ +1c0380932459f43a111e5788c44e1219 scl-utils-2.0.2.tar.gz diff --git a/scl-utils-2.0.2.tar.gz b/scl-utils-2.0.2.tar.gz deleted file mode 100644 index 863070bf06108e516460bed7867903e115a7fe75..0000000000000000000000000000000000000000 Binary files a/scl-utils-2.0.2.tar.gz and /dev/null differ diff --git a/scl-utils.spec b/scl-utils.spec index e455dc49bfdbdc5aa6c531df57f2fc7e15ba7411..e34761e08bcbd3a04384d13617fdbc22664705ee 100644 --- a/scl-utils.spec +++ b/scl-utils.spec @@ -3,7 +3,7 @@ Name: scl-utils Epoch: 1 Version: 2.0.2 -Release: 14%{?dist} +Release: 15%{?dist} Summary: Utilities for alternative packaging License: GPLv2+ @@ -21,6 +21,7 @@ Patch2: 0004-define-macro-python-explicitly.patch Patch3: BZ-1618803-adapt-env-parser-to-new-module-output.patch Patch4: BZ-1927971-let-scl_source-behave-with-errexit.patch Patch5: BZ-1867135-print-scl_source-errors-to-stderr.patch +Patch6: BZ-1967686-do-not-error-out-on-SIGINT.patch %description Run-time utility for alternative packaging. @@ -83,6 +84,9 @@ ln -s prefixes conf %{_rpmconfigdir}/brp-scl-python-bytecompile %changelog +* Thu Feb 17 2022 Michal Domonkos - 1:2.0.2-15 +- Don't error out when command receives SIGINT (#1967686) + * Tue Jul 13 2021 Michal Domonkos - 1:2.0.2-14 - Print scl_source errors to stderr (#1867135)