import scl-utils-2.0.2-13.el8

This commit is contained in:
CentOS Sources 2021-03-30 07:03:50 -04:00 committed by Stepan Oksanichenko
parent 2b1bb959c7
commit 81628bdd57
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,29 @@
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

View File

@ -3,7 +3,7 @@
Name: scl-utils
Epoch: 1
Version: 2.0.2
Release: 12%{?dist}
Release: 13%{?dist}
Summary: Utilities for alternative packaging
License: GPLv2+
@ -19,6 +19,7 @@ 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
%description
Run-time utility for alternative packaging.
@ -81,6 +82,9 @@ ln -s prefixes conf
%{_rpmconfigdir}/brp-scl-python-bytecompile
%changelog
* 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)
* Mon Feb 17 2020 Michal Domonkos <mdomonko@redhat.com> - 1:2.0.2-12
- Adapt env parser to new module(1) output (#1618803)