1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 05:09:24 +00:00

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.

(From OE-Core rev: 25cb71799e72d4e0c4fe39653d8b84280d087372)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Patrick Ohly
2015-06-15 10:20:49 +02:00
committed by Richard Purdie
parent 4caed87a38
commit 553305eee8
+2 -1
View File
@@ -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