From: Patrick Ohly Date: Mon, 15 Jun 2015 08:20:49 +0000 (+0200) Subject: logging.bbclass: avoid bashism in bbdebug() X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~30050 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25cb71799e72d4e0c4fe39653d8b84280d087372;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.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 78d65bda3af..f6648b21190 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