From: Harald Hoyer Date: Fri, 16 Apr 2010 14:43:34 +0000 (+0200) Subject: dracut-lib: turn of shell debug mode in strstr and getarg(s) X-Git-Tag: 006~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d149cd039dd865e9cb83e289bb7bc7eae124a71;p=thirdparty%2Fdracut-ng.git dracut-lib: turn of shell debug mode in strstr and getarg(s) --- diff --git a/modules.d/99base/dracut-lib.sh b/modules.d/99base/dracut-lib.sh index de235666a..e9c2ccce3 100644 --- a/modules.d/99base/dracut-lib.sh +++ b/modules.d/99base/dracut-lib.sh @@ -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; }