File pacemaker-tools-bash-portability-issue-in-crm_failcount.patch of Package pacemaker.26413

commit 4ab4b5769598ff18982254d509b99c088b0bc8b7
Author: Ken Gaillot <kgaillot@redhat.com>
Date:   Thu May 10 11:59:00 2018 -0500

    Low: tools: bash portability issue in crm_failcount
    
    Apparently not all versions of bash allow a trailing | in a match pattern to
    specify "nothing", e.g.  (s|sec|)

diff --git a/tools/crm_failcount.in b/tools/crm_failcount.in
index c1c61b4ad..85a6761b4 100755
--- a/tools/crm_failcount.in
+++ b/tools/crm_failcount.in
@@ -51,7 +51,10 @@ parse_interval() {
 
 	INT_8601RE="^P(([0-9]+)Y)?(([0-9]+)M)?(([0-9]+)D)?T?(([0-9]+)H)?(([0-9]+)M)?(([0-9]+)S)?$"
 	
-	if [[ $INT_S =~ $(interval_re "s|sec|") ]]; then
+	if [[ $INT_S =~ $(interval_re "") ]]; then
+		echo $(( ${BASH_REMATCH[1]} * 1000 ))
+
+	elif [[ $INT_S =~ $(interval_re "s|sec") ]]; then
 		echo $(( ${BASH_REMATCH[1]} * 1000 ))
 
 	elif [[ $INT_S =~ $(interval_re "ms|msec") ]]; then
openSUSE Build Service is sponsored by