From 25cb71799e72d4e0c4fe39653d8b84280d087372 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Mon, 15 Jun 2015 10:20:49 +0200 Subject: logging.bbclass: avoid bashism in bbdebug() 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 Signed-off-by: Ross Burton --- meta/classes/logging.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'meta/classes/logging.bbclass') diff --git a/meta/classes/logging.bbclass b/meta/classes/logging.bbclass index 78d65bda3a..f6648b2119 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 -- cgit 1.2.3-korg