From 02fe7df28923e7d4aec5e27c7fa2ad189b9389fe Mon Sep 17 00:00:00 2001 From: eabdullin Date: Wed, 14 May 2025 15:35:39 +0000 Subject: [PATCH] import UBI scl-utils-2.0.3-5.el10 --- .gitignore | 2 +- .scl-utils.metadata | 1 - ...-patch-from-fedora-famillecollet.com.patch | 0 ...Z-2056462-do-not-error-out-on-SIGINT.patch | 0 ....patch => BZ-2091000-remove-tmp-file.patch | 0 .../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 ----- brp-python-hardlink.patch | 29 +++++ ...os.scl-filesystem => macros.scl-filesystem | 2 - SPECS/scl-utils.spec => scl-utils.spec | 118 ++++++++++++------ sources | 1 + 13 files changed, 111 insertions(+), 188 deletions(-) delete mode 100644 .scl-utils.metadata rename SOURCES/0003-Scl-utils-layout-patch-from-fedora-famillecollet.com.patch => 0003-Scl-utils-layout-patch-from-fedora-famillecollet.com.patch (100%) rename SOURCES/BZ-1967686-do-not-error-out-on-SIGINT.patch => BZ-2056462-do-not-error-out-on-SIGINT.patch (100%) rename SOURCES/BZ-2091000-remove-tmp-file.patch => BZ-2091000-remove-tmp-file.patch (100%) delete mode 100644 SOURCES/0004-define-macro-python-explicitly.patch delete mode 100644 SOURCES/BZ-1618803-adapt-env-parser-to-new-module-output.patch delete mode 100644 SOURCES/BZ-1867135-print-scl_source-errors-to-stderr.patch delete mode 100644 SOURCES/BZ-1927971-let-scl_source-behave-with-errexit.patch create mode 100644 brp-python-hardlink.patch rename SOURCES/macros.scl-filesystem => macros.scl-filesystem (99%) rename SPECS/scl-utils.spec => scl-utils.spec (79%) create mode 100644 sources diff --git a/.gitignore b/.gitignore index e33dc4a..f7160bf 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/scl-utils-2.0.2.tar.gz +scl-utils-2.0.3.tar.gz diff --git a/.scl-utils.metadata b/.scl-utils.metadata deleted file mode 100644 index abd1f61..0000000 --- a/.scl-utils.metadata +++ /dev/null @@ -1 +0,0 @@ -25607da2aeb02211be14ff00db41e90b134641e6 SOURCES/scl-utils-2.0.2.tar.gz diff --git a/SOURCES/0003-Scl-utils-layout-patch-from-fedora-famillecollet.com.patch b/0003-Scl-utils-layout-patch-from-fedora-famillecollet.com.patch similarity index 100% rename from SOURCES/0003-Scl-utils-layout-patch-from-fedora-famillecollet.com.patch rename to 0003-Scl-utils-layout-patch-from-fedora-famillecollet.com.patch diff --git a/SOURCES/BZ-1967686-do-not-error-out-on-SIGINT.patch b/BZ-2056462-do-not-error-out-on-SIGINT.patch similarity index 100% rename from SOURCES/BZ-1967686-do-not-error-out-on-SIGINT.patch rename to BZ-2056462-do-not-error-out-on-SIGINT.patch diff --git a/SOURCES/BZ-2091000-remove-tmp-file.patch b/BZ-2091000-remove-tmp-file.patch similarity index 100% rename from SOURCES/BZ-2091000-remove-tmp-file.patch rename to BZ-2091000-remove-tmp-file.patch diff --git a/SOURCES/0004-define-macro-python-explicitly.patch b/SOURCES/0004-define-macro-python-explicitly.patch deleted file mode 100644 index 463cd80..0000000 --- a/SOURCES/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/SOURCES/BZ-1618803-adapt-env-parser-to-new-module-output.patch b/SOURCES/BZ-1618803-adapt-env-parser-to-new-module-output.patch deleted file mode 100644 index f50070d..0000000 --- a/SOURCES/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/SOURCES/BZ-1867135-print-scl_source-errors-to-stderr.patch b/SOURCES/BZ-1867135-print-scl_source-errors-to-stderr.patch deleted file mode 100644 index 564e5c1..0000000 --- a/SOURCES/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/SOURCES/BZ-1927971-let-scl_source-behave-with-errexit.patch b/SOURCES/BZ-1927971-let-scl_source-behave-with-errexit.patch deleted file mode 100644 index a93fecf..0000000 --- a/SOURCES/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/brp-python-hardlink.patch b/brp-python-hardlink.patch new file mode 100644 index 0000000..ef16755 --- /dev/null +++ b/brp-python-hardlink.patch @@ -0,0 +1,29 @@ +From e75f3f522f34e1cdd19852763363dd8b503e305e Mon Sep 17 00:00:00 2001 +From: Michal Nowak +Date: Tue, 7 Dec 2021 17:35:01 +0100 +Subject: [PATCH] Update brp-python-hardlink path + +Since Fedora 35 "brp-python-hardlink" script is in /usr/lib/rpm/redhat/. +Otherwise RPM build fails with: + + + /usr/lib/rpm/brp-python-hardlink + /var/tmp/rpm-tmp.VsVGRP: line 312: /usr/lib/rpm/brp-python-hardlink: No such file or directory + +Fixes #42 +--- + rpm/macros.scl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rpm/macros.scl b/rpm/macros.scl +index f1ee5f2..0d27a6b 100644 +--- a/rpm/macros.scl ++++ b/rpm/macros.scl +@@ -91,7 +91,7 @@ package or when debugging this package. + } + /usr/lib/rpm/brp-strip-static-archive %{__strip} + /usr/lib/rpm/brp-scl-python-bytecompile %{__python3} %{?_python_bytecompile_errors_terminate_build} %{_scl_root} +- /usr/lib/rpm/brp-python-hardlink ++ [ -f /usr/lib/rpm/redhat/brp-python-hardlink ] && /usr/lib/rpm/redhat/brp-python-hardlink || /usr/lib/rpm/brp-python-hardlink + %{nil}} + BuildRequires: scl-utils-build + %if "%{?scl}%{!?scl:0}" == "%{pkg_name}" diff --git a/SOURCES/macros.scl-filesystem b/macros.scl-filesystem similarity index 99% rename from SOURCES/macros.scl-filesystem rename to macros.scl-filesystem index 4a5178b..b64cba6 100644 --- a/SOURCES/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/SPECS/scl-utils.spec b/scl-utils.spec similarity index 79% rename from SPECS/scl-utils.spec rename to scl-utils.spec index 16e4f8f..20c2582 100644 --- a/SPECS/scl-utils.spec +++ b/scl-utils.spec @@ -1,35 +1,32 @@ +%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: 16%{?dist} +Version: 2.0.3 +Release: 5%{?dist} Summary: Utilities for alternative packaging -License: GPLv2+ -Group: Applications/File +License: GPL-2.0-or-later 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 -Patch7: BZ-2091000-remove-tmp-file.patch +Patch2: BZ-2056462-do-not-error-out-on-SIGINT.patch +Patch3: BZ-2091000-remove-tmp-file.patch +Patch4: brp-python-hardlink.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 @@ -40,12 +37,10 @@ Essential RPM build macros for alternative packaging. %autosetup -p1 %build -%cmake +%cmake . make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" - %install -rm -rf %{buildroot} make install DESTDIR=%{buildroot} if [ %{macrosdir} != %{_sysconfdir}/rpm ]; then mkdir -p %{buildroot}%{macrosdir} @@ -59,8 +54,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 @@ -76,7 +73,6 @@ ln -s prefixes conf %doc LICENSE %files build -%defattr(-,root,root,-) %{macrosdir}/macros.scl %{_rpmconfigdir}/scldeps.sh %{_rpmconfigdir}/fileattrs/scl.attr @@ -85,38 +81,84 @@ ln -s prefixes conf %{_rpmconfigdir}/brp-scl-python-bytecompile %changelog -* Tue Dec 13 2022 Florian Festi - 1:2.0.2-16 -- Remove tmp file (#2091000) +* Tue Oct 29 2024 Troy Dawson - 1:2.0.3-5 +- Bump release for October 2024 mass rebuild: + Resolves: RHEL-64018 -* Thu Feb 17 2022 Michal Domonkos - 1:2.0.2-15 -- Don't error out when command receives SIGINT (#1967686) +* Tue Aug 27 2024 Brian Stinson - 2.0.3-4 +- Bump NVR to maintain upgrade path with RHEL 9 + Related: RHEL-52633 -* Tue Jul 13 2021 Michal Domonkos - 1:2.0.2-14 -- Print scl_source errors to stderr (#1867135) +* Mon Jun 24 2024 Troy Dawson - 1:2.0.3-3 +- Bump release for June 2024 mass rebuild -* Tue Feb 16 2021 Michal Domonkos - 1:2.0.2-13 -- Let scl_source behave when -e/errexit is set (#1927971, James E. Flemer) +* Sat Jan 27 2024 Fedora Release Engineering - 1:2.0.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild -* Mon Feb 17 2020 Michal Domonkos - 1:2.0.2-12 -- Adapt env parser to new module(1) output (#1618803) +* Wed Aug 23 2023 Remi Collet - 1:2.0.3-1 +- Rebase to 2.0.3 +- add upstream patch to fix brp-python-hardlink path +- use SPDX license ID +- run upstream tests -* Fri Aug 16 2019 Pavlina Moravcova Varekova - 1:2.0.2-11 -- reverted sci-utils-build own the pkgconfig directory (#1431962) +* Sat Jul 22 2023 Fedora Release Engineering - 1:2.0.2-24 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_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 Jun 02 2023 Michal Nowak - 2.0.2-23 +- Support F35+ "brp-python-hardlink" script location. + Resolves: rhbz#2029959 -* 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) +* Mon May 29 2023 Petr Pisar - 1:2.0.2-22 +- Rebuild against rpm-4.19 (https://fedoraproject.org/wiki/Changes/RPM-4.19) -* Wed May 22 2019 Pavlina Moravcova Varekova - 1:2.0.2-8 -- Own directory /etc/scl (#1616405) +* Sat Jan 21 2023 Fedora Release Engineering - 1:2.0.2-21 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Sat Jul 23 2022 Fedora Release Engineering - 1:2.0.2-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Sat Jan 22 2022 Fedora Release Engineering - 1:2.0.2-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Jul 23 2021 Fedora Release Engineering - 1:2.0.2-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed Jan 27 2021 Fedora Release Engineering - 1:2.0.2-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jul 29 2020 Vitaly Zaitsev - 1:2.0.2-16 +- Backported upstream patches to resolve RHBZ#1728450. + +* Wed Jul 29 2020 Fedora Release Engineering - 1:2.0.2-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Fri Jul 24 2020 Jeff Law - 1:2.0.2-14 +- Use __cmake_in_source_build + +* Thu Jan 30 2020 Fedora Release Engineering - 1:2.0.2-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* 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 diff --git a/sources b/sources new file mode 100644 index 0000000..12ec0c9 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (scl-utils-2.0.3.tar.gz) = 3d18a435003d37264afbbac83c1cbd533b76b44661f613ac9e28f8ed1c08b00cda90e567573711fc8f101174d8937ddab320961b1da4fbdfa137a1f50c3f4486