fix direct scl_source --help output

This commit is contained in:
wang_yue111 2021-10-08 14:36:08 +08:00
parent e2041d1288
commit 6708221d13
2 changed files with 38 additions and 1 deletions

View File

@ -0,0 +1,33 @@
From 54ca3bd3293bd9815712d7d8aaf1fe45f13e5d5e Mon Sep 17 00:00:00 2001
From: Pavel Raiskup <praiskup@redhat.com>
Date: Fri, 11 Oct 2019 12:41:11 +0200
Subject: [PATCH] fix direct 'scl_source --help' output
Wrap everything into 'if then else fi' statement, so we don't actually need 'return' statement. Without this wrapping hack, we'd need either 'exit' statement (if executed by /usr/bin/scl_source) or 'return' for 'source scl_source'. For more info see #20.
---
shell/scl_source | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/shell/scl_source b/shell/scl_source
index b0036bd..294740f 100755
--- a/shell/scl_source
+++ b/shell/scl_source
@@ -9,8 +9,7 @@ Options:
if [ $# -eq 0 -o $1 = "-h" -o $1 = "--help" ]; then
echo "$_scl_source_help"
- return 0
-fi
+else # main operation mode
if [ -z "$_recursion" ]; then
@@ -73,3 +72,5 @@ if [ $_recursion == "false" ]; then
_scl_scriptlet_name=""
_recursion="false"
fi
+
+fi # main operation mode
--
2.23.0

View File

@ -3,7 +3,7 @@
Name: scl-utils
Epoch: 1
Version: 2.0.2
Release: 1
Release: 2
Summary: Utilities for alternative packaging
License: GPLv2+
URL: https://github.com/sclorg/scl-utils
@ -15,6 +15,7 @@ Buildrequires: rpm-devel
Requires: %{_bindir}/modulecmd
Patch1: 0003-Scl-utils-layout-patch-from-fedora-famillecollet.com.patch
Patch100: scl-utils-2.0.2-rhbz-1728450.patch
Patch101: fix-direct-scl_source-help-output.patch
%description
Run-time utility for alternative packaging.
@ -69,5 +70,8 @@ ln -s prefixes conf
%{_rpmconfigdir}/brp-scl-python-bytecompile
%changelog
* Fri Oct 08 2021 wangyue <wangyue92@huawei.com> - 2.0.2-2
- fix direct scl_source --help output
* Tue Sep 7 2021 zhengyaohui <zhengyaohui1@huawei.com> - 2.0.2-1
- package init