Compare commits
10 Commits
183ce0eb17
...
c108dff9a4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c108dff9a4 | ||
|
|
7669c5dd72 | ||
|
|
4fef66ca77 | ||
|
|
e36e30db0c | ||
|
|
43d19f7319 | ||
|
|
4eab43affb | ||
|
|
0ae9d30530 | ||
|
|
e25fff7606 | ||
|
|
0a658a05bc | ||
|
|
f7cd9a3490 |
61
BZ-2056462-do-not-error-out-on-SIGINT.patch
Normal file
61
BZ-2056462-do-not-error-out-on-SIGINT.patch
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
From 9147d3b66e0a263c2eb427b7892b34c925363854 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Michal Domonkos <mdomonko@redhat.com>
|
||||||
|
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 <errno.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <dirent.h>
|
||||||
|
+#include <signal.h>
|
||||||
|
|
||||||
|
#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 <rpm/rpmcli.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <wordexp.h>
|
||||||
|
+#include <signal.h>
|
||||||
|
|
||||||
|
#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
|
||||||
|
|
||||||
21
BZ-2091000-remove-tmp-file.patch
Normal file
21
BZ-2091000-remove-tmp-file.patch
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
From 864844ecc11f8cf65cd97bcffdb803211f7edaa4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Piotr Wilkosz <piotr.wilkosz@gmail.com>
|
||||||
|
Date: Mon, 23 May 2022 16:14:13 +0200
|
||||||
|
Subject: [PATCH] remove tmp file at exit
|
||||||
|
|
||||||
|
---
|
||||||
|
src/fallback.c | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/src/fallback.c b/src/fallback.c
|
||||||
|
index c907a34..e67654a 100644
|
||||||
|
--- a/src/fallback.c
|
||||||
|
+++ b/src/fallback.c
|
||||||
|
@@ -246,6 +246,7 @@ scl_rc fallback_run_command(char * const colnames[], const char *cmd, bool exec)
|
||||||
|
enable_path = _free(enable_path);
|
||||||
|
colpath = _free(colpath);
|
||||||
|
bash_cmd = _free(bash_cmd);
|
||||||
|
+ unlink(tmp);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
34
add-h-option-to-scl-command.patch
Normal file
34
add-h-option-to-scl-command.patch
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
From 09116bb68bb76c9f6432511f5a0f054a2e3b92e0 Mon Sep 17 00:00:00 2001
|
||||||
|
From: caodongxia <315816521@qq.com>
|
||||||
|
Date: Tue, 12 Oct 2021 19:47:01 +0800
|
||||||
|
Subject: [PATCH] add -h option to scl-command
|
||||||
|
|
||||||
|
---
|
||||||
|
src/scl.c | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/scl.c b/src/scl.c
|
||||||
|
index df8111a..1c7854a 100644
|
||||||
|
--- a/src/scl.c
|
||||||
|
+++ b/src/scl.c
|
||||||
|
@@ -25,7 +25,7 @@ static void print_usage( const char *name ) {
|
||||||
|
fprintf(stderr, " %s load|unload [<collection>...]\n", basename(name));
|
||||||
|
fprintf(stderr, " %s list-collections\n", basename(name));
|
||||||
|
fprintf(stderr, " %s list-packages|man|register|deregister <collection>\n", basename(name));
|
||||||
|
- fprintf(stderr, " %s --help\n\n", basename(name));
|
||||||
|
+ fprintf(stderr, " %s -h|--help\n\n", basename(name));
|
||||||
|
|
||||||
|
fprintf(stderr,
|
||||||
|
"description:\n"
|
||||||
|
@@ -36,7 +36,7 @@ static void print_usage( const char *name ) {
|
||||||
|
" list-packages list packages in Software Collection\n"
|
||||||
|
" man show manual page about Software Collection\n"
|
||||||
|
" register|deregister register/deregister Software Collection\n"
|
||||||
|
- " --help show this help\n"
|
||||||
|
+ " -h|--help show this help\n"
|
||||||
|
"\nUse '-' as <command> to read the command from standard input.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
From 54ca3bd3293bd9815712d7d8aaf1fe45f13e5d5e Mon Sep 17 00:00:00 2001
|
|
||||||
From: Pavel Raiskup <praiskup@redhat.com>
|
|
||||||
Date: Fri, 11 Oct 2019 12:41:11 +0200
|
|
||||||
Subject: [PATCH] fix direct 'scl_source --help' output
|
|
||||||
|
|
||||||
Wrap everything into 'if then else fi' statement, so we don't actually need 'return' statement. Without this wrapping hack, we'd need either 'exit' statement (if executed by /usr/bin/scl_source) or 'return' for 'source scl_source'. For more info see #20.
|
|
||||||
---
|
|
||||||
shell/scl_source | 5 +++--
|
|
||||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/shell/scl_source b/shell/scl_source
|
|
||||||
index b0036bd..294740f 100755
|
|
||||||
--- a/shell/scl_source
|
|
||||||
+++ b/shell/scl_source
|
|
||||||
@@ -9,8 +9,7 @@ Options:
|
|
||||||
|
|
||||||
if [ $# -eq 0 -o $1 = "-h" -o $1 = "--help" ]; then
|
|
||||||
echo "$_scl_source_help"
|
|
||||||
- return 0
|
|
||||||
-fi
|
|
||||||
+else # main operation mode
|
|
||||||
|
|
||||||
|
|
||||||
if [ -z "$_recursion" ]; then
|
|
||||||
@@ -73,3 +72,5 @@ if [ $_recursion == "false" ]; then
|
|
||||||
_scl_scriptlet_name=""
|
|
||||||
_recursion="false"
|
|
||||||
fi
|
|
||||||
+
|
|
||||||
+fi # main operation mode
|
|
||||||
--
|
|
||||||
2.23.0
|
|
||||||
|
|
||||||
@ -1,54 +0,0 @@
|
|||||||
From 3538686a21279c60c916e82ece02efcd88ae95b9 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Joe Orton <jorton@redhat.com>
|
|
||||||
Date: Thu, 8 Aug 2019 09:26:00 +0100
|
|
||||||
Subject: [PATCH] Fix crashes in "scl list-enabled":
|
|
||||||
|
|
||||||
* src/lib_common.c (merge_string_arrays):
|
|
||||||
Ensure elements of returned array are strdup()ed.
|
|
||||||
|
|
||||||
* src/scllib.c (get_enabled_collections):
|
|
||||||
Ensure all elements of returned array are strdup()ed.
|
|
||||||
|
|
||||||
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1728450
|
|
||||||
---
|
|
||||||
src/lib_common.c | 5 +++++
|
|
||||||
src/scllib.c | 2 +-
|
|
||||||
2 files changed, 6 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/lib_common.c b/src/lib_common.c
|
|
||||||
index 1aa49a0..2e7d116 100644
|
|
||||||
--- a/src/lib_common.c
|
|
||||||
+++ b/src/lib_common.c
|
|
||||||
@@ -7,6 +7,7 @@
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <wordexp.h>
|
|
||||||
+#include <assert.h>
|
|
||||||
|
|
||||||
#include "errors.h"
|
|
||||||
#include "scllib.h"
|
|
||||||
@@ -269,6 +270,10 @@ char **merge_string_arrays(char *const *array1, char *const *array2)
|
|
||||||
}
|
|
||||||
merged_array[++prev] = NULL;
|
|
||||||
|
|
||||||
+ for (int i = 0; i < prev; i++) {
|
|
||||||
+ merged_array[i] = xstrdup(merged_array[i]);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
return merged_array;
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/scllib.c b/src/scllib.c
|
|
||||||
index ce8df90..3c32d65 100644
|
|
||||||
--- a/src/scllib.c
|
|
||||||
+++ b/src/scllib.c
|
|
||||||
@@ -107,8 +107,8 @@ scl_rc get_enabled_collections(char ***_enabled_collections)
|
|
||||||
sizeof(SCL_MODULES_PATH - 1))){
|
|
||||||
|
|
||||||
enabled_collections[i] += sizeof(SCL_MODULES_PATH);
|
|
||||||
- enabled_collections[i] = xstrdup(enabled_collections[i]);
|
|
||||||
}
|
|
||||||
+ enabled_collections[i] = xstrdup(enabled_collections[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Binary file not shown.
BIN
scl-utils-2.0.3.tar.gz
Normal file
BIN
scl-utils-2.0.3.tar.gz
Normal file
Binary file not shown.
@ -1,9 +1,10 @@
|
|||||||
%global __cmake_in_source_build 1
|
%global __cmake_in_source_build 1
|
||||||
%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
|
%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
|
||||||
|
%global vendor %{?_vendor:%{_vendor}}%{!?_vendor:openEuler}
|
||||||
Name: scl-utils
|
Name: scl-utils
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
Version: 2.0.2
|
Version: 2.0.3
|
||||||
Release: 2
|
Release: 1
|
||||||
Summary: Utilities for alternative packaging
|
Summary: Utilities for alternative packaging
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
URL: https://github.com/sclorg/scl-utils
|
URL: https://github.com/sclorg/scl-utils
|
||||||
@ -12,16 +13,18 @@ Source1: macros.scl-filesystem
|
|||||||
BuildRequires: gcc make
|
BuildRequires: gcc make
|
||||||
Buildrequires: cmake
|
Buildrequires: cmake
|
||||||
Buildrequires: rpm-devel
|
Buildrequires: rpm-devel
|
||||||
|
Buildrequires: libcmocka-devel
|
||||||
Requires: %{_bindir}/modulecmd
|
Requires: %{_bindir}/modulecmd
|
||||||
Patch1: 0003-Scl-utils-layout-patch-from-fedora-famillecollet.com.patch
|
Patch1: 0003-Scl-utils-layout-patch-from-fedora-famillecollet.com.patch
|
||||||
Patch100: scl-utils-2.0.2-rhbz-1728450.patch
|
Patch100: BZ-2056462-do-not-error-out-on-SIGINT.patch
|
||||||
Patch101: fix-direct-scl_source-help-output.patch
|
Patch101: BZ-2091000-remove-tmp-file.patch
|
||||||
|
Patch102: add-h-option-to-scl-command.patch
|
||||||
%description
|
%description
|
||||||
Run-time utility for alternative packaging.
|
Run-time utility for alternative packaging.
|
||||||
|
|
||||||
%package build
|
%package build
|
||||||
Summary: RPM build macros for alternative packaging
|
Summary: RPM build macros for alternative packaging
|
||||||
Requires: iso-codes redhat-rpm-config
|
Requires: iso-codes %{vendor}-rpm-config
|
||||||
%description build
|
%description build
|
||||||
Essential RPM build macros for alternative packaging.
|
Essential RPM build macros for alternative packaging.
|
||||||
|
|
||||||
@ -47,6 +50,9 @@ mkdir modulefiles
|
|||||||
mkdir prefixes
|
mkdir prefixes
|
||||||
ln -s prefixes conf
|
ln -s prefixes conf
|
||||||
|
|
||||||
|
%check
|
||||||
|
make check
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%dir %{_sysconfdir}/scl/modulefiles
|
%dir %{_sysconfdir}/scl/modulefiles
|
||||||
%dir %{_sysconfdir}/scl/prefixes
|
%dir %{_sysconfdir}/scl/prefixes
|
||||||
@ -70,8 +76,20 @@ ln -s prefixes conf
|
|||||||
%{_rpmconfigdir}/brp-scl-python-bytecompile
|
%{_rpmconfigdir}/brp-scl-python-bytecompile
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Fri Oct 08 2021 wangyue <wangyue92@huawei.com> - 2.0.2-2
|
* Fri Apr 14 2023 yaoxin <yao_xin001@hoperun.com> - 1:2.0.3-1
|
||||||
|
- Update to 2.0.3
|
||||||
|
|
||||||
|
* Thu Nov 17 2022 caodongxia <caodongxia@h-partners.com> - 1:2.0.2-5
|
||||||
|
- Replace oenEuler with the vendor macro
|
||||||
|
|
||||||
|
* Tue Mar 1 2022 yangping <yangping69@huawei.com> - 1:2.0.2-4
|
||||||
|
- Fix need config
|
||||||
|
|
||||||
|
* Tue Oct 12 2021 caodongxia <caodongxia@huawei.com> - 1:2.0.2-3
|
||||||
|
- add -h option to scl command
|
||||||
|
|
||||||
|
* Fri Oct 08 2021 wangyue <wangyue92@huawei.com> - 1:2.0.2-2
|
||||||
- fix direct scl_source --help output
|
- fix direct scl_source --help output
|
||||||
|
|
||||||
* Tue Sep 7 2021 zhengyaohui <zhengyaohui1@huawei.com> - 2.0.2-1
|
* Tue Sep 7 2021 zhengyaohui <zhengyaohui1@huawei.com> - 1:2.0.2-1
|
||||||
- package init
|
- package init
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user