Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade: scl-utils version to 2.0.3 #11898

Open
wants to merge 1 commit into
base: 3.0-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
From 9147d3b66e0a263c2eb427b7892b34c925363854 Mon Sep 17 00:00:00 2001
From: Michal Domonkos <[email protected]>
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 changes: 21 additions & 0 deletions SPECS-EXTENDED/scl-utils/BZ-2091000-remove-tmp-file.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
From 864844ecc11f8cf65cd97bcffdb803211f7edaa4 Mon Sep 17 00:00:00 2001
From: Piotr Wilkosz <[email protected]>
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;
}
29 changes: 29 additions & 0 deletions SPECS-EXTENDED/scl-utils/brp-python-hardlink.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From e75f3f522f34e1cdd19852763363dd8b503e305e Mon Sep 17 00:00:00 2001
From: Michal Nowak <[email protected]>
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}"
25 changes: 25 additions & 0 deletions SPECS-EXTENDED/scl-utils/rpm-bare-words.patch
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion SPECS-EXTENDED/scl-utils/scl-utils.signatures.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
76 changes: 67 additions & 9 deletions SPECS-EXTENDED/scl-utils/scl-utils.spec
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -75,11 +85,59 @@ ln -s prefixes conf
%{_rpmconfigdir}/brp-scl-python-bytecompile

%changelog
* Fri Oct 29 2021 Muhammad Falak <[email protected]> - 2.0.2-15
- Remove epoch
* Tue Jan 14 2025 Archana Shettigar <[email protected]> - 1:2.0.3-5
- Initial Azure Linux import from Fedora 41 (license: MIT).
- Removed Epoch
- License Verified

* Thu Sep 12 2024 Remi Collet <[email protected]> - 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 <[email protected]> - 1:2.0.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Sat Jan 27 2024 Fedora Release Engineering <[email protected]> - 1:2.0.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Wed Aug 23 2023 Remi Collet <[email protected]> - 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 <[email protected]> - 1:2.0.2-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Fri Jun 02 2023 Michal Nowak <[email protected]> - 2.0.2-23
- Support F35+ "brp-python-hardlink" script location.
Resolves: rhbz#2029959

* Mon May 29 2023 Petr Pisar <[email protected]> - 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 <[email protected]> - 1:2.0.2-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Sat Jul 23 2022 Fedora Release Engineering <[email protected]> - 1:2.0.2-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Sat Jan 22 2022 Fedora Release Engineering <[email protected]> - 1:2.0.2-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Fri Jul 23 2021 Fedora Release Engineering <[email protected]> - 1:2.0.2-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Wed Jan 27 2021 Fedora Release Engineering <[email protected]> - 1:2.0.2-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Wed Jul 29 2020 Vitaly Zaitsev <[email protected]> - 1:2.0.2-16
- Backported upstream patches to resolve RHBZ#1728450.

* Wed Jul 29 2020 Fedora Release Engineering <[email protected]> - 1:2.0.2-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Fri Oct 15 2021 Pawel Winogrodzki <pawelwi@microsoft.com> - 1:2.0.2-14
- Initial CBL-Mariner import from Fedora 32 (license: MIT).
* 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 <[email protected]> - 1:2.0.2-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Expand Down
4 changes: 2 additions & 2 deletions cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
},
Expand Down