File 0010-main-script-support-trace-messages.patch of Package SuSEfirewall2.6458

From c138662b1fca4770bfa0fa16fe331a5990531450 Mon Sep 17 00:00:00 2001
From: Matthias Gerstner <matthias.gerstner@suse.de>
Date: Mon, 27 Nov 2017 16:38:38 +0100
Subject: [PATCH 1/3] main script: support --trace messages

Since debug mode is actually more a kind of pretend mode we need
something else for just outputting diagnostic information. This is it.
---
 SuSEfirewall2 | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/SuSEfirewall2 b/SuSEfirewall2
index 9766814..f8285cb 100755
--- a/SuSEfirewall2
+++ b/SuSEfirewall2
@@ -132,6 +132,13 @@ dbgmessage()
     message $*
 }
 
+tracemessage()
+{
+    $TRACE || return
+
+    message ${FUNCNAME[1]} $*
+}
+
 deprecated()
 {
     warning "$@ is deprecated and will likely be removed in the future."
@@ -263,6 +270,7 @@ IP6TABLES_HAVE_REJECT=1
 
 ACTION="start"
 MODE="standard"
+TRACE=false
 INITSCRIPTS="" # on|off
 needconfig=
 needlock=1
@@ -274,7 +282,7 @@ if test -x /usr/bin/tty && ! /usr/bin/tty -s; then
     quiet=1
 fi
 
-getopttmp=`/usr/bin/getopt -o hqi: --long help,scriptsdir:,batch,nobatch,file:,debug,test,bootlock,bootunlock,quiet,interface: \
+getopttmp=`/usr/bin/getopt -o hqi: --long help,scriptsdir:,batch,nobatch,file:,debug,trace,test,bootlock,bootunlock,quiet,interface: \
      -n 'SuSEfirewall2' -- "$@"`
 
 [ $? != 0 ] && die 1 "getopt error"
@@ -289,6 +297,7 @@ while true ; do
                 --scriptsdir) SCRIPTSDIR="$2" ; shift 2 ;;
                 --test) MODE="test" ; shift ;;
                 --debug) MODE="debug"; needlock=0 ; shift ;;
+                --trace) TRACE=true ; shift ;;
                 --bootlock) create_bootlock=1 ; shift ;;
                 --bootunlock) remove_bootlock=1 ; shift ;;
                 -h|--help) help ; shift ;;
-- 
2.13.6

openSUSE Build Service is sponsored by