diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2015-06-15 10:20:49 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-06-23 11:46:56 +0100 |
commit | 553305eee83f5291f9f9d30253a0be47d1d1fb49 (patch) | |
tree | 54e5893bdb71a5887264b148e8f5916645d6e9b1 /meta/classes/logging.bbclass | |
parent | 4caed87a38e8c5afef679a90fb7f74f26ece2043 (diff) | |
download | poky-553305eee83f5291f9f9d30253a0be47d1d1fb49.tar.gz |
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>
Diffstat (limited to 'meta/classes/logging.bbclass')
-rw-r--r-- | meta/classes/logging.bbclass | 3 |
1 files changed, 2 insertions, 1 deletions
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() { | |||
62 | 62 | ||
63 | # Strip off the debug level and ensure it is an integer | 63 | # Strip off the debug level and ensure it is an integer |
64 | DBGLVL=$1; shift | 64 | DBGLVL=$1; shift |
65 | if ! [[ "$DBGLVL" =~ ^[0-9]+ ]]; then | 65 | NONDIGITS=$(echo "$DBGLVL" | tr -d [:digit:]) |
66 | if [ "$NONDIGITS" ]; then | ||
66 | bbfatal "$USAGE" | 67 | bbfatal "$USAGE" |
67 | fi | 68 | fi |
68 | 69 | ||