]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
dracut-lib: turn of shell debug mode in strstr and getarg(s)
authorHarald Hoyer <harald@redhat.com>
Fri, 16 Apr 2010 14:43:34 +0000 (16:43 +0200)
committerHarald Hoyer <harald@redhat.com>
Fri, 16 Apr 2010 15:59:48 +0000 (17:59 +0200)
modules.d/99base/dracut-lib.sh

index de235666af8ab5aa38299a8d19aee35709ac0caa..e9c2ccce335771c7bc37b7f24c4c5e9a5e5cee0a 100644 (file)
@@ -5,6 +5,7 @@ strstr() {
 }
 
 getarg() {
+    set +x 
     local o line
     if [ -z "$CMDLINE" ]; then
         if [ -e /etc/cmdline ]; then
@@ -16,13 +17,15 @@ getarg() {
        CMDLINE="$CMDLINE $CMDLINE_ETC"
     fi
     for o in $CMDLINE; do
-       [ "$o" = "$1" ] && return 0
-       [ "${o%%=*}" = "${1%=}" ] && { echo ${o#*=}; return 0; }
+       [ "$o" = "$1" ] && { [ "$RDDEBUG" = "yes" ] && set -x; return 0; }
+       [ "${o%%=*}" = "${1%=}" ] && { echo ${o#*=}; [ "$RDDEBUG" = "yes" ] && set -x; return 0; }
     done
+    [ "$RDDEBUG" = "yes" ] && set -x 
     return 1
 }
 
 getargs() {
+    set +x 
     local o line found
     if [ -z "$CMDLINE" ]; then
        if [ -e /etc/cmdline ]; then
@@ -34,13 +37,14 @@ getargs() {
        CMDLINE="$CMDLINE $CMDLINE_ETC"
     fi
     for o in $CMDLINE; do
-       [ "$o" = "$1" ] && return 0
+       [ "$o" = "$1" ] && { [ "$RDDEBUG" = "yes" ] && set -x; return 0; }
        if [ "${o%%=*}" = "${1%=}" ]; then
            echo -n "${o#*=} "; 
            found=1;
        fi
     done
-    [ -n "$found" ] && return 0
+    [ -n "$found" ] && { [ "$RDDEBUG" = "yes" ] && set -x; return 0; }
+    [ "$RDDEBUG" = "yes" ] && set -x 
     return 1;
 }