From e6090678f6da062d9fcdeaca61102ac734b680c3 Mon Sep 17 00:00:00 2001 From: "taifu.gc" Date: Wed, 14 Dec 2022 02:00:44 +0800 Subject: [PATCH] update to scl-utils-2.0.3-2.el9.src.rpm --- 0004-define-macro-python-explicitly.patch | 11 --- ...dapt-env-parser-to-new-module-output.patch | 76 ---------------- ...35-print-scl_source-errors-to-stderr.patch | 30 ------ ...1-let-scl_source-behave-with-errexit.patch | 29 ------ BZ-1967686-do-not-error-out-on-SIGINT.patch | 61 ------------- download | 2 +- macros.scl-filesystem | 2 - scl-utils.spec | 91 +++++++++++-------- 8 files changed, 54 insertions(+), 248 deletions(-) delete mode 100644 0004-define-macro-python-explicitly.patch delete mode 100644 BZ-1618803-adapt-env-parser-to-new-module-output.patch delete mode 100644 BZ-1867135-print-scl_source-errors-to-stderr.patch delete mode 100644 BZ-1927971-let-scl_source-behave-with-errexit.patch delete mode 100644 BZ-1967686-do-not-error-out-on-SIGINT.patch diff --git a/0004-define-macro-python-explicitly.patch b/0004-define-macro-python-explicitly.patch deleted file mode 100644 index 463cd80..0000000 --- a/0004-define-macro-python-explicitly.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- scl-utils-2.0.2/rpm/macros.scl.old 2019-07-04 09:27:29.887470341 +0200 -+++ scl-utils-2.0.2/rpm/macros.scl 2019-07-30 10:24:32.536648421 +0200 -@@ -93,7 +93,7 @@ - /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} - } - /usr/lib/rpm/brp-strip-static-archive %{__strip} -- /usr/lib/rpm/brp-scl-python-bytecompile %{__python} %{?_python_bytecompile_errors_terminate_build} %{_scl_root} -+ /usr/lib/rpm/brp-scl-python-bytecompile %{__python3} %{?_python_bytecompile_errors_terminate_build} %{_scl_root} - /usr/lib/rpm/brp-python-hardlink - %{nil}} - BuildRequires: scl-utils-build diff --git a/BZ-1618803-adapt-env-parser-to-new-module-output.patch b/BZ-1618803-adapt-env-parser-to-new-module-output.patch deleted file mode 100644 index f50070d..0000000 --- a/BZ-1618803-adapt-env-parser-to-new-module-output.patch +++ /dev/null @@ -1,76 +0,0 @@ -commit 98fe4dcef136eaaa323f1729c11f38b2b19b3a42 -Author: Michal Domonkos -Date: Mon Jan 13 17:04:41 2020 +0100 - - Adapt env parser to newer module(1) versions. BZ 1618803 - - With module(1) version 4.x and later (tcl-based), the command - - MODULE_CMD sh load - - prints a newline after each export line, breaking our parsing logic in - get_env_vars() which just tokenizes the output by semicolons and does - not anticipate newlines. As a result, we would end up with - "\nKEY=VALUE" pairs and pass them as such to putenv(3) which then has no - effect. - - The fix is easy; just strip the leading newline from the KEY=VALUE pairs - if present. This ensures we stay compatible with the older module(1) - versions as well. - - A simple reproducer follows: - - 1) Make scl(1) run in "modulefile" mode by creating a modulefile in - /etc/scl/modulefiles corresponding to a collection, for example: - - $ /usr/share/Modules/bin/createmodule.sh /opt/rh/eap7/enable \ - > /etc/scl/modulefiles/eap7 - - 2) Run a simple scl(1) command to detect the presence of an env var - that we know should be set in the target collection, for example: - - $ scl enable eap7 'echo $LOADEDMODULES' - - Previously, there would be no output. With this commit, the output - should be "eap7". - -diff --git a/src/scllib.c b/src/scllib.c -index 3c32d65..a182194 100644 ---- a/src/scllib.c -+++ b/src/scllib.c -@@ -52,7 +52,7 @@ static scl_rc get_env_vars(const char *colname, char ***_vars) - char *argv[] = {MODULE_CMD, MODULE_CMD, "sh", "add", "", NULL}; - char *output = NULL; - int i = 0; -- char **parts, **vars; -+ char **parts, *part, **vars; - scl_rc ret = EOK; - - ret = initialize_env(); -@@ -73,16 +73,21 @@ static scl_rc get_env_vars(const char *colname, char ***_vars) - * Expected format of string stored in variable output is following: - * var1=value1 ;export value1 ; var2=value2 ;export value2; - * var3=value\ with\ spaces -+ * NOTE: Newer (tcl-based) versions of MODULE_CMD put a newline after each -+ * export command so we need to take that into account. - */ - - vars = parts = split(output, ';'); - - /* Filter out strings without "=" i. e. strings with export. */ -- while (*parts != NULL) { -- if (strchr(*parts, '=')) { -- strip_trailing_chars(*parts, ' '); -- unescape_string(*parts); -- vars[i++] = xstrdup(*parts); -+ while (*parts != NULL) { -+ part = *parts; -+ if (part[0] == '\n') -+ part++; -+ if (strchr(part, '=')) { -+ strip_trailing_chars(part, ' '); -+ unescape_string(part); -+ vars[i++] = xstrdup(part); - } - parts++; - } diff --git a/BZ-1867135-print-scl_source-errors-to-stderr.patch b/BZ-1867135-print-scl_source-errors-to-stderr.patch deleted file mode 100644 index 564e5c1..0000000 --- a/BZ-1867135-print-scl_source-errors-to-stderr.patch +++ /dev/null @@ -1,30 +0,0 @@ -commit 835ffbb5753036c4b58626869a4f0f5b30945707 -Author: Michal Domonkos -Date: Tue Jul 13 17:01:07 2021 +0200 - - Print scl_source errors to stderr - - Resolves: rhbz#1867135 - -diff --git a/shell/scl_source b/shell/scl_source -index 30b8baf..c810cb9 100755 ---- a/shell/scl_source -+++ b/shell/scl_source -@@ -34,7 +34,7 @@ for arg in "$@"; do - _scl_prefix_file=$_scl_dir/$arg - _scl_prefix=`cat $_scl_prefix_file 2> /dev/null` - if [ $? -ne 0 ]; then -- echo "Can't read $_scl_prefix_file, $arg is probably not installed." -+ echo >&2 "Can't read $_scl_prefix_file, $arg is probably not installed." - return 1 - fi - -@@ -60,7 +60,7 @@ if [ $_recursion == "false" ]; then - _scl_scriptlet_path="${_scl_prefixes[$_i]}/${_scls[$_i]}/${_scl_scriptlet_name}" - source "$_scl_scriptlet_path" - if [ $? -ne 0 ]; then -- echo "Can't source $_scl_scriptlet_name, skipping." -+ echo >&2 "Can't source $_scl_scriptlet_name, skipping." - else - export X_SCLS="${_scls[$_i]} $X_SCLS" - fi; diff --git a/BZ-1927971-let-scl_source-behave-with-errexit.patch b/BZ-1927971-let-scl_source-behave-with-errexit.patch deleted file mode 100644 index a93fecf..0000000 --- a/BZ-1927971-let-scl_source-behave-with-errexit.patch +++ /dev/null @@ -1,29 +0,0 @@ -From a8113846229a567321ca4347b07263936307b940 Mon Sep 17 00:00:00 2001 -From: "James E. Flemer" -Date: Tue, 16 Feb 2021 02:48:27 -0700 -Subject: [PATCH] Let scl_source behave when "-e"/errexit is set (#35) - -Jenkins pipelines, among other things, use `set -e` (aka bash `errexit`) to abort on "errors". So when `source scl_source` is used in a pipeline, the way the exit code from `scl_enabled` is checked via `$?` causes an unintended abort of the pipeline. (Workaround is to use `set +e; source scl_source ...; set -e`.) - -This trivial change to `scl_source` simply changes how the value of `scl_enalbed` is checked to be friendly to `errexit`. ---- - shell/scl_source | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/shell/scl_source b/shell/scl_source -index 5822955..30b8baf 100755 ---- a/shell/scl_source -+++ b/shell/scl_source -@@ -47,8 +47,7 @@ for arg in "$@"; do - done - - # Now check if the collection isn't already enabled -- /usr/bin/scl_enabled $arg > /dev/null 2> /dev/null -- if [ $? -ne 0 ]; then -+ if ! /usr/bin/scl_enabled $arg > /dev/null 2> /dev/null; then - _scls+=($arg) - _scl_prefixes+=($_scl_prefix) - fi; --- -2.29.2 - diff --git a/BZ-1967686-do-not-error-out-on-SIGINT.patch b/BZ-1967686-do-not-error-out-on-SIGINT.patch deleted file mode 100644 index 3a076eb..0000000 --- a/BZ-1967686-do-not-error-out-on-SIGINT.patch +++ /dev/null @@ -1,61 +0,0 @@ -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 index f58d80d..faa2117 100644 --- a/download +++ b/download @@ -1 +1 @@ -1c0380932459f43a111e5788c44e1219 scl-utils-2.0.2.tar.gz +438dee233c7c2ea7ebba26a441e5a2a7 scl-utils-2.0.3.tar.gz diff --git a/macros.scl-filesystem b/macros.scl-filesystem index 4a5178b..b64cba6 100644 --- a/macros.scl-filesystem +++ b/macros.scl-filesystem @@ -102,9 +102,7 @@ mkdir -p %{buildroot}%{_root_sysconfdir}/{rpm,scl/{prefixes,modulefiles}} cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config << EOF %%%%scl %scl %{?nfsmountable:%%%%nfsmountable %{nfsmountable}} -%{!?nfsmountable:%%%%undefine nfsmountable} %{?rh_layout:%%%%rh_layout %{rh_layout}} -%{!?rh_layout:%%%%undefine rh_layout} EOF cat >> %{buildroot}%{_root_sysconfdir}/scl/prefixes/%{scl} << EOF %_scl_prefix diff --git a/scl-utils.spec b/scl-utils.spec index a74b9ff..411f541 100644 --- a/scl-utils.spec +++ b/scl-utils.spec @@ -1,41 +1,32 @@ -%define anolis_release .0.1 +%global __cmake_in_source_build 1 %global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) Name: scl-utils Epoch: 1 -Version: 2.0.2 -Release: 15%{anolis_release}%{?dist} +Version: 2.0.3 +Release: 2%{?dist} Summary: Utilities for alternative packaging License: GPLv2+ -Group: Applications/File URL: https://github.com/sclorg/scl-utils Source0: https://github.com/sclorg/%{name}/archive/%{version}/%{name}-%{version}.tar.gz Source1: macros.scl-filesystem BuildRequires: gcc make -Buildrequires: cmake -Buildrequires: rpm-devel +BuildRequires: cmake +BuildRequires: rpm-devel +BuildRequires: libcmocka libcmocka-devel environment-modules Requires: %{_bindir}/modulecmd Patch1: 0003-Scl-utils-layout-patch-from-fedora-famillecollet.com.patch -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. %package build Summary: RPM build macros for alternative packaging -Group: Applications/File Requires: iso-codes Requires: redhat-rpm-config -Requires: glibc -Provides: /usr/bin/scl - %description build Essential RPM build macros for alternative packaging. @@ -43,7 +34,7 @@ Essential RPM build macros for alternative packaging. %autosetup -p1 %build -%cmake +%cmake . make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" @@ -62,8 +53,10 @@ mkdir modulefiles mkdir prefixes ln -s prefixes conf +%check +make check + %files -%defattr(-,root,root,-) %dir %{_sysconfdir}/scl %dir %{_sysconfdir}/scl/modulefiles %dir %{_sysconfdir}/scl/prefixes @@ -79,7 +72,6 @@ ln -s prefixes conf %doc LICENSE %files build -%defattr(-,root,root,-) %{macrosdir}/macros.scl %{_rpmconfigdir}/scldeps.sh %{_rpmconfigdir}/fileattrs/scl.attr @@ -88,38 +80,61 @@ ln -s prefixes conf %{_rpmconfigdir}/brp-scl-python-bytecompile %changelog -* Sun Jul 17 2022 Xiaoping Liu - 1:2.0.2-15.0.1 -- Modified requires +* Tue Aug 10 2021 Mohan Boddu - 1:2.0.3-2 +- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags + Related: rhbz#1991688 + +* Mon Jul 26 2021 Michal Domonkos - 1:2.0.3-1 +- Rebase to 2.0.3 (#1986085) + +* Mon Jul 26 2021 Michal Domonkos - 1:2.0.2-21 +- Own directory /etc/scl (#1986040) + +* Fri Jul 23 2021 Honza Horak - 1:2.0.2-20 +- Fix problem with python version in the byte compilation script (#1984598) -* Thu Feb 17 2022 Michal Domonkos - 1:2.0.2-15 -- Don't error out when command receives SIGINT (#1967686) +* Wed May 12 2021 Michal Domonkos - 1:2.0.2-19 +- Fix dist tag syntax (#1958982) -* Tue Jul 13 2021 Michal Domonkos - 1:2.0.2-14 -- Print scl_source errors to stderr (#1867135) +* Fri Apr 16 2021 Mohan Boddu - 1:2.0.2-18 +- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 -* Tue Feb 16 2021 Michal Domonkos - 1:2.0.2-13 -- Let scl_source behave when -e/errexit is set (#1927971, James E. Flemer) +* Wed Jan 27 2021 Fedora Release Engineering - 1:2.0.2-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild -* Mon Feb 17 2020 Michal Domonkos - 1:2.0.2-12 -- Adapt env parser to new module(1) output (#1618803) +* Wed Jul 29 2020 Vitaly Zaitsev - 1:2.0.2-16 +- Backported upstream patches to resolve RHBZ#1728450. -* Fri Aug 16 2019 Pavlina Moravcova Varekova - 1:2.0.2-11 -- reverted sci-utils-build own the pkgconfig directory (#1431962) +* Wed Jul 29 2020 Fedora Release Engineering - 1:2.0.2-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild -* Tue Jul 30 2019 Pavlina Moravcova Varekova - 1:2.0.2-10 -- use %%__python3 instead of macro %%__python (#1733526) -- corrected unescaped per-cent character in the changelog (#1734103) +* Fri Jul 24 2020 Jeff Law - 1:2.0.2-14 +- Use __cmake_in_source_build -* Tue Jul 02 2019 Pavlina Moravcova Varekova - 1:2.0.2-9 -- use %%{?dist} instead of %%{dist} (#1725774) -- scl-utils-build own the pkgconfig directory by %%scl_files (#1431962) +* Thu Jan 30 2020 Fedora Release Engineering - 1:2.0.2-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild -* Wed May 22 2019 Pavlina Moravcova Varekova - 1:2.0.2-8 -- Own directory /etc/scl (#1616405) +* Thu Aug 22 2019 Remi Collet - 1:2.0.2-12 +- Fix error: macro %%undefine is a built-in #1744583 + +* Fri Jul 26 2019 Fedora Release Engineering - 1:2.0.2-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Mon Jun 10 22:13:23 CET 2019 Igor Gnatenko - 1:2.0.2-10 +- Rebuild for RPM 4.15 + +* Mon Jun 10 15:42:05 CET 2019 Igor Gnatenko - 1:2.0.2-9 +- Rebuild for RPM 4.15 + +* Sat Feb 02 2019 Fedora Release Engineering - 1:2.0.2-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Tue Jul 24 2018 Vít Ondruch - 1:2.0.2-7 - Don't enforce modulefile ownership. +* Sat Jul 14 2018 Fedora Release Engineering - 1:2.0.2-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Mon Feb 19 2018 Panu Matilainen - 1:2.0.2-5 - Explicitly BuildRequire gcc and make -- Gitee