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>
# 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