Checking the bbdebug() debug level parameter with a regular
test expression only works in bash. Using tr to filter out
digits and then checking whether anything is left achieves
the same result and is more portable.

Signed-off-by: Patrick Ohly <patrick.o...@intel.com>
---
 meta/classes/logging.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes/logging.bbclass b/
index 78d65bd..f6648b2 100644
--- a/meta/classes/logging.bbclass
+++ b/meta/classes/logging.bbclass
@@ -62,7 +62,8 @@ bbdebug() {
        
        # Strip off the debug level and ensure it is an integer
        DBGLVL=$1; shift
-       if ! [[ "$DBGLVL" =~ ^[0-9]+ ]]; then
+       NONDIGITS=$(echo "$DBGLVL" | tr -d [:digit:])
+       if [ "$NONDIGITS" ]; then
                bbfatal "$USAGE"
        fi
 
-- 
2.1.4

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to