From: Patrick Ohly Date: Mon, 15 Jun 2015 08:20:49 +0000 (+0200) Subject: logging.bbclass: avoid bashism in bbdebug() X-Git-Tag: 2015-10~1537 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=25cb71799e72d4e0c4fe39653d8b84280d087372;p=openembedded-core.git 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 --- 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