973febb
From 84b54cb2ea9c3744f327d617f2797efd1f6ac617 Mon Sep 17 00:00:00 2001
973febb
From: Dalibor Pospisil <dapospis@redhat.com>
973febb
Date: Wed, 22 May 2019 11:10:38 +0200
973febb
Subject: [PATCH 1/8] do not masque exit code by 'local' directive
973febb
973febb
if a variable is set with an command output within local directive,
973febb
the exit code of that command gets lost and exit code of the 'local'
973febb
is used instead which is basically always 0.
973febb
---
973febb
 src/journal.sh | 3 ++-
973febb
 1 file changed, 2 insertions(+), 1 deletion(-)
973febb
973febb
diff --git a/src/journal.sh b/src/journal.sh
973febb
index 128f9f2..2e8d616 100644
973febb
--- a/src/journal.sh
973febb
+++ b/src/journal.sh
973febb
@@ -810,8 +810,9 @@ __INTERNAL_CreateHeader(){
973febb
     __INTERNAL_LogText "    Test name     : ${__INTERNAL_TEST_NAME}" 2> /dev/null
973febb
 
973febb
     local test_version="${testversion:-$TESTVERSION}"
973febb
+    local test_rpm
973febb
     # get number of itesm of BASH_SOURCE-1 to get last item of the array
973febb
-    local test_rpm=$(rpm -qf ${BASH_SOURCE[$((${#BASH_SOURCE[@]}-1))]} 2> /dev/null) \
973febb
+    test_rpm=$(rpm -qf ${BASH_SOURCE[$((${#BASH_SOURCE[@]}-1))]} 2> /dev/null) \
973febb
       && test_version=$(rpm --qf "%{version}-%{release}" -q $test_rpm 2> /dev/null)
973febb
 
973febb
     [[ -n "$test_version" ]] && {
973febb
-- 
973febb
2.21.0
973febb