]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-lib: do not leave debug mode in getarg and getargs
authorHarald Hoyer <harald@redhat.com>
Fri, 15 Jan 2010 11:34:50 +0000 (12:34 +0100)
committerHarald Hoyer <harald@redhat.com>
Fri, 15 Jan 2010 13:07:54 +0000 (14:07 +0100)
modules.d/99base/dracut-lib.sh

index 42db21a4ce703befb70bde9a7d173ca37e52e178..5b2b2c1a0a19a1e2de807a511452b5be18a41d36 100644 (file)
@@ -1,5 +1,4 @@
 getarg() {
-    set +x
     local o line
     if [ -z "$CMDLINE" ]; then
         if [ -e /etc/cmdline ]; then
@@ -12,28 +11,12 @@ getarg() {
     fi
     for o in $CMDLINE; do
        [ "$o" = "$1" ] && return 0
-       [ "${o%%=*}" = "${1%=}" ] && { echo ${o#*=}; setdebug; return 0; }
+       [ "${o%%=*}" = "${1%=}" ] && { echo ${o#*=}; return 0; }
     done
-    setdebug
     return 1
 }
 
-setdebug() {
-    if [ -z "$RDDEBUG" ]; then
-        if [ -e /proc/cmdline ]; then
-            RDDEBUG=no
-           if getarg rdinitdebug; then
-                RDDEBUG=yes 
-            fi
-        fi
-    fi
-    [ "$RDDEBUG" = "yes" ] && set -x 
-}
-
-setdebug
-
 getargs() {
-    set +x
     local o line found
     if [ -z "$CMDLINE" ]; then
        if [ -e /etc/cmdline ]; then
@@ -51,11 +34,23 @@ getargs() {
            found=1;
        fi
     done
-    [ -n "$found" ] && { setdebug; return 0;}
-    setdebug
-    return 1
+    [ -n "$found" ] && return 0
+    return 1;
 }
 
+setdebug() {
+    if [ -z "$RDDEBUG" ]; then
+        if [ -e /proc/cmdline ]; then
+            RDDEBUG=no
+           if getarg rdinitdebug; then
+                RDDEBUG=yes 
+            fi
+        fi
+    fi
+    [ "$RDDEBUG" = "yes" ] && set -x 
+}
+
+
 source_all() {
     local f
     [ "$1" ] && [  -d "/$1" ] || return