diff options
author | Ross Burton <ross.burton@arm.com> | 2023-09-06 16:16:48 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-09-07 07:53:51 +0100 |
commit | 056a8bbe1eb2369ec0605c41c3e3837e1de03865 (patch) | |
tree | e8d00b68f75a1f9f4a7b50dc1a00145d12092f9f | |
parent | 0fce19ee9ee166267fb61b625c33c477ae58c350 (diff) | |
download | poky-056a8bbe1eb2369ec0605c41c3e3837e1de03865.tar.gz |
scripts/oe-find-native-sysroot: use bitbake-getvar
Instead of bitbake and grep, just use bitbake-getvar.
(From OE-Core rev: b5011a2fc248d88b5491cf6af1fc15e5974f6e45)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | scripts/oe-find-native-sysroot | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/scripts/oe-find-native-sysroot b/scripts/oe-find-native-sysroot index 5146bbf999..6228efcbee 100755 --- a/scripts/oe-find-native-sysroot +++ b/scripts/oe-find-native-sysroot | |||
@@ -36,20 +36,9 @@ if [ "$1" = '--help' -o "$1" = '-h' -o $# -ne 1 ] ; then | |||
36 | fi | 36 | fi |
37 | 37 | ||
38 | # Global vars | 38 | # Global vars |
39 | BITBAKE_E="" | ||
40 | set_oe_native_sysroot(){ | 39 | set_oe_native_sysroot(){ |
41 | echo "Running bitbake -e $1" | 40 | echo "Getting sysroot..." |
42 | BITBAKE_E="`bitbake -e $1`" | 41 | OECORE_NATIVE_SYSROOT=$(bitbake-getvar -r $1 --value STAGING_DIR_NATIVE) |
43 | OECORE_NATIVE_SYSROOT=`echo "$BITBAKE_E" | grep ^STAGING_DIR_NATIVE= | cut -d '"' -f2` | ||
44 | |||
45 | if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then | ||
46 | # This indicates that there was an error running bitbake -e that | ||
47 | # the user needs to be informed of | ||
48 | echo "There was an error running bitbake to determine STAGING_DIR_NATIVE" | ||
49 | echo "Here is the output from bitbake -e $1" | ||
50 | echo $BITBAKE_E | ||
51 | exit 1 | ||
52 | fi | ||
53 | } | 42 | } |
54 | 43 | ||
55 | if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then | 44 | if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then |