]> code.ossystems Code Review - openembedded-core.git/commitdiff
logging: fix oedebug loglevel test
authorDarren Hart <dvhart@linux.intel.com>
Thu, 21 Apr 2011 23:56:49 +0000 (16:56 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 28 Apr 2011 08:52:28 +0000 (09:52 +0100)
When the existing test for loglevel fails, the syntax used results in the recipe
exiting with a silent failure. Performing any bash command after the test block
resolves the problem, such as "shift" or "echo ''". Rewriting with 'if []; then'
blocks provides a cleaner syntax and also resolves the failure.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
meta/classes/base.bbclass

index 44fab534056e96f17ac179851d76fe8a097ecfdc..7ca396db5e01e4ac0e67be419745391c43cc5c2e 100644 (file)
@@ -53,15 +53,15 @@ oefatal() {
 }
 
 oedebug() {
-       test $# -ge 2 || {
+       if [ $# -lt 2]; then
                echo "Usage: oedebug level \"message\""
                exit 1
-       }
+       fi
 
-       test ${OEDEBUG:-0} -ge $1 && {
+       if [ ${OEDEBUG:-0} -ge $1 ]; then
                shift
                echo "DEBUG:" $*
-       }
+       fi
 }
 
 oe_runmake() {