Compare commits

...

1 Commits
c8 ... c10

Author SHA1 Message Date
02fe7df289 import UBI scl-utils-2.0.3-5.el10 2025-05-14 15:35:39 +00:00
13 changed files with 111 additions and 188 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/scl-utils-2.0.2.tar.gz
scl-utils-2.0.3.tar.gz

View File

@ -1 +0,0 @@
25607da2aeb02211be14ff00db41e90b134641e6 SOURCES/scl-utils-2.0.2.tar.gz

View File

@ -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

View File

@ -1,76 +0,0 @@
commit 98fe4dcef136eaaa323f1729c11f38b2b19b3a42
Author: Michal Domonkos <mdomonko@redhat.com>
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 <collection>
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++;
}

View File

@ -1,30 +0,0 @@
commit 835ffbb5753036c4b58626869a4f0f5b30945707
Author: Michal Domonkos <mdomonko@redhat.com>
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;

View File

@ -1,29 +0,0 @@
From a8113846229a567321ca4347b07263936307b940 Mon Sep 17 00:00:00 2001
From: "James E. Flemer" <james.flemer@ndpgroup.com>
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

29
brp-python-hardlink.patch Normal file
View File

@ -0,0 +1,29 @@
From e75f3f522f34e1cdd19852763363dd8b503e305e Mon Sep 17 00:00:00 2001
From: Michal Nowak <mnowak@isc.org>
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}"

View File

@ -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

View File

@ -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 <ffesti@redhat.com> - 1:2.0.2-16
- Remove tmp file (#2091000)
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1:2.0.3-5
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Thu Feb 17 2022 Michal Domonkos <mdomonko@redhat.com> - 1:2.0.2-15
- Don't error out when command receives SIGINT (#1967686)
* Tue Aug 27 2024 Brian Stinson <bstinson@redhat.com> - 2.0.3-4
- Bump NVR to maintain upgrade path with RHEL 9
Related: RHEL-52633
* Tue Jul 13 2021 Michal Domonkos <mdomonko@redhat.com> - 1:2.0.2-14
- Print scl_source errors to stderr (#1867135)
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1:2.0.3-3
- Bump release for June 2024 mass rebuild
* Tue Feb 16 2021 Michal Domonkos <mdomonko@redhat.com> - 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 <releng@fedoraproject.org> - 1:2.0.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Feb 17 2020 Michal Domonkos <mdomonko@redhat.com> - 1:2.0.2-12
- Adapt env parser to new module(1) output (#1618803)
* Wed Aug 23 2023 Remi Collet <remi@remirepo/net> - 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 <pmoravco@redhat.com> - 1:2.0.2-11
- reverted sci-utils-build own the pkgconfig directory (#1431962)
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.2-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Jul 30 2019 Pavlina Moravcova Varekova <pmoravco@redhat.com> - 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 <mnowak@isc.org> - 2.0.2-23
- Support F35+ "brp-python-hardlink" script location.
Resolves: rhbz#2029959
* Tue Jul 02 2019 Pavlina Moravcova Varekova <pmoravco@redhat.com> - 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 <ppisar@redhat.com> - 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 <pmoravco@redhat.com> - 1:2.0.2-8
- Own directory /etc/scl (#1616405)
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.2-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.2-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.2-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.2-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.2-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jul 29 2020 Vitaly Zaitsev <vitaly@easycoding.org> - 1:2.0.2-16
- Backported upstream patches to resolve RHBZ#1728450.
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.2-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri Jul 24 2020 Jeff Law <law@redhat.com> - 1:2.0.2-14
- Use __cmake_in_source_build
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.2-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Aug 22 2019 Remi Collet <remi@remirepo.net> - 1:2.0.2-12
- Fix error: macro %%undefine is a built-in #1744583
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 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 <ignatenkobrain@fedoraproject.org> - 1:2.0.2-10
- Rebuild for RPM 4.15
* Mon Jun 10 15:42:05 CET 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1:2.0.2-9
- Rebuild for RPM 4.15
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.2-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Tue Jul 24 2018 Vít Ondruch <vondruch@redhat.com> - 1:2.0.2-7
- Don't enforce modulefile ownership.
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:2.0.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon Feb 19 2018 Panu Matilainen <pmatilai@redhat.com> - 1:2.0.2-5
- Explicitly BuildRequire gcc and make

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (scl-utils-2.0.3.tar.gz) = 3d18a435003d37264afbbac83c1cbd533b76b44661f613ac9e28f8ed1c08b00cda90e567573711fc8f101174d8937ddab320961b1da4fbdfa137a1f50c3f4486