logging.bbclass: avoid bashism in bbdebug()
PATCH 1/1 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 <[email protected]>
--- meta/classes/logging.bbclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
meta/classes/logging.bbclass +2 -1
@@ -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
Signature · 1 line
2.1.4