From 436ecfc1eb3883e4c163ecdc2f0d69239e824ef2 Mon Sep 17 00:00:00 2001 From: archana25-ms Date: Tue, 14 Jan 2025 05:11:23 +0000 Subject: [PATCH] Upgrade: scl-utils version to 2.0.3 --- ...Z-2056462-do-not-error-out-on-SIGINT.patch | 61 +++++++++++++++ .../BZ-2091000-remove-tmp-file.patch | 21 +++++ .../scl-utils/brp-python-hardlink.patch | 29 +++++++ SPECS-EXTENDED/scl-utils/rpm-bare-words.patch | 25 ++++++ .../scl-utils/scl-utils.signatures.json | 2 +- SPECS-EXTENDED/scl-utils/scl-utils.spec | 76 ++++++++++++++++--- cgmanifest.json | 4 +- 7 files changed, 206 insertions(+), 12 deletions(-) create mode 100644 SPECS-EXTENDED/scl-utils/BZ-2056462-do-not-error-out-on-SIGINT.patch create mode 100644 SPECS-EXTENDED/scl-utils/BZ-2091000-remove-tmp-file.patch create mode 100644 SPECS-EXTENDED/scl-utils/brp-python-hardlink.patch create mode 100644 SPECS-EXTENDED/scl-utils/rpm-bare-words.patch diff --git a/SPECS-EXTENDED/scl-utils/BZ-2056462-do-not-error-out-on-SIGINT.patch b/SPECS-EXTENDED/scl-utils/BZ-2056462-do-not-error-out-on-SIGINT.patch new file mode 100644 index 00000000000..3a076eb0b06 --- /dev/null +++ b/SPECS-EXTENDED/scl-utils/BZ-2056462-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/SPECS-EXTENDED/scl-utils/BZ-2091000-remove-tmp-file.patch b/SPECS-EXTENDED/scl-utils/BZ-2091000-remove-tmp-file.patch new file mode 100644 index 00000000000..3c4436c727c --- /dev/null +++ b/SPECS-EXTENDED/scl-utils/BZ-2091000-remove-tmp-file.patch @@ -0,0 +1,21 @@ +From 864844ecc11f8cf65cd97bcffdb803211f7edaa4 Mon Sep 17 00:00:00 2001 +From: Piotr Wilkosz +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; + } diff --git a/SPECS-EXTENDED/scl-utils/brp-python-hardlink.patch b/SPECS-EXTENDED/scl-utils/brp-python-hardlink.patch new file mode 100644 index 00000000000..ef167557b1f --- /dev/null +++ b/SPECS-EXTENDED/scl-utils/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/SPECS-EXTENDED/scl-utils/rpm-bare-words.patch b/SPECS-EXTENDED/scl-utils/rpm-bare-words.patch new file mode 100644 index 00000000000..86a35e755b1 --- /dev/null +++ b/SPECS-EXTENDED/scl-utils/rpm-bare-words.patch @@ -0,0 +1,25 @@ +diff -up ./rpm/macros.scl.old ./rpm/macros.scl +--- ./rpm/macros.scl.old 2024-08-21 10:07:50.179485587 +0200 ++++ ./rpm/macros.scl 2024-08-21 10:08:32.739167017 +0200 +@@ -7,10 +7,10 @@ + %define old_debug %{lua:print(rpm.expand("%{debug_package}"):len())} + %undefine _debugsource_packages + %global debug_package %{expand: +-%if "%{?old_debug}" == "0" ++%if "%{?old_debug}" == "0" + %{expand: %{nil}} + %else +-%if "%{?scl}%{!?scl:0}" == "%{pkg_name}" ++%if 0 + %{expand: %{nil}} + %else + %ifnarch noarch +@@ -97,7 +97,7 @@ package or when debugging this package. + [ -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}" ++%if 0 + Requires: %{scl_runtime} + Provides: scl-package(%{scl}) + %endif diff --git a/SPECS-EXTENDED/scl-utils/scl-utils.signatures.json b/SPECS-EXTENDED/scl-utils/scl-utils.signatures.json index fd1d88fd4c1..b857a962cb0 100644 --- a/SPECS-EXTENDED/scl-utils/scl-utils.signatures.json +++ b/SPECS-EXTENDED/scl-utils/scl-utils.signatures.json @@ -1,6 +1,6 @@ { "Signatures": { "macros.scl-filesystem": "2bfa921050d74057f53f862274e27231726b5b97080267f1060cb709cde077be", - "scl-utils-2.0.2.tar.gz": "37bf43985d39422bee77a28014e6211b88e0dc1a7ab6c8367b0273b613a82543" + "scl-utils-2.0.3.tar.gz": "a24edd604522b9a06a320a3c49f6f544bd88d2a6e40012ece3527fd53473aa8b" } } diff --git a/SPECS-EXTENDED/scl-utils/scl-utils.spec b/SPECS-EXTENDED/scl-utils/scl-utils.spec index 61dde2dcb65..184fd91a770 100644 --- a/SPECS-EXTENDED/scl-utils/scl-utils.spec +++ b/SPECS-EXTENDED/scl-utils/scl-utils.spec @@ -1,22 +1,28 @@ Vendor: Microsoft Corporation Distribution: Azure Linux +%global __cmake_in_source_build 1 %global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) Name: scl-utils -Version: 2.0.2 -Release: 15%{?dist} +Version: 2.0.3 +Release: 5%{?dist} Summary: Utilities for alternative packaging -License: GPLv2+ +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: BZ-2056462-do-not-error-out-on-SIGINT.patch +Patch3: BZ-2091000-remove-tmp-file.patch +Patch4: brp-python-hardlink.patch +Patch5: rpm-bare-words.patch %description Run-time utility for alternative packaging. @@ -52,7 +58,11 @@ mkdir modulefiles mkdir prefixes ln -s prefixes conf +%check +make check + %files +%dir %{_sysconfdir}/scl %dir %{_sysconfdir}/scl/modulefiles %dir %{_sysconfdir}/scl/prefixes %{_sysconfdir}/scl/conf @@ -75,11 +85,59 @@ ln -s prefixes conf %{_rpmconfigdir}/brp-scl-python-bytecompile %changelog -* Fri Oct 29 2021 Muhammad Falak - 2.0.2-15 -- Remove epoch +* Tue Jan 14 2025 Archana Shettigar - 1:2.0.3-5 +- Initial Azure Linux import from Fedora 41 (license: MIT). +- Removed Epoch +- License Verified + +* Thu Sep 12 2024 Remi Collet - 1:2.0.3-4 +- add workaround to "bare words are no longer supported" in RPM 4.20 #2306492 + +* Sat Jul 20 2024 Fedora Release Engineering - 1:2.0.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Sat Jan 27 2024 Fedora Release Engineering - 1:2.0.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* 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 + +* Sat Jul 22 2023 Fedora Release Engineering - 1:2.0.2-24 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Fri Jun 02 2023 Michal Nowak - 2.0.2-23 +- Support F35+ "brp-python-hardlink" script location. + Resolves: rhbz#2029959 + +* Mon May 29 2023 Petr Pisar - 1:2.0.2-22 +- Rebuild against rpm-4.19 (https://fedoraproject.org/wiki/Changes/RPM-4.19) + +* 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 Oct 15 2021 Pawel Winogrodzki - 1:2.0.2-14 -- Initial CBL-Mariner import from Fedora 32 (license: MIT). +* 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 diff --git a/cgmanifest.json b/cgmanifest.json index a89ce2a4c56..2d81d875f0d 100644 --- a/cgmanifest.json +++ b/cgmanifest.json @@ -27344,8 +27344,8 @@ "type": "other", "other": { "name": "scl-utils", - "version": "2.0.2", - "downloadUrl": "https://github.com/sclorg/scl-utils/archive/2.0.2/scl-utils-2.0.2.tar.gz" + "version": "2.0.3", + "downloadUrl": "https://github.com/sclorg/scl-utils/archive/2.0.3/scl-utils-2.0.3.tar.gz" } } },