[poky] [PATCH 1/3] logging: fix oedebug loglevel test
Darren Hart
dvhart at linux.intel.com
Mon Apr 25 12:36:42 PDT 2011
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 at linux.intel.com>
---
meta/classes/base.bbclass | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 2157fe9..374ca04 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() {
--
1.7.1
More information about the poky
mailing list