From 43493742a06d9266033c93c97fb545e8755f8ae6 Mon Sep 17 00:00:00 2001 From: Darren Hart Date: Thu, 21 Apr 2011 16:56:49 -0700 Subject: logging: fix oedebug loglevel test 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. (From OE-Core rev: 5857516404411040598b69c85d184ccdfc0af2e0) Signed-off-by: Darren Hart Signed-off-by: Richard Purdie --- meta/classes/base.bbclass | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 4fd83020d9..2dcbcb3dc9 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -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() { -- cgit v1.2.3-54-g00ecf