]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
scripts/oe-find-native-sysroot: use bitbake-getvar
authorRoss Burton <ross.burton@arm.com>
Wed, 6 Sep 2023 15:16:48 +0000 (16:16 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 7 Sep 2023 06:52:34 +0000 (07:52 +0100)
Instead of bitbake and grep, just use bitbake-getvar.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/oe-find-native-sysroot

index 5146bbf99990f2f6429f48e2a1542333bab5e3e0..6228efcbeec7289924f1ea0d5fbe32ba4cb7f048 100755 (executable)
@@ -36,20 +36,9 @@ if [ "$1" = '--help' -o "$1" = '-h' -o $# -ne 1 ] ; then
 fi
 
 # Global vars
-BITBAKE_E=""
 set_oe_native_sysroot(){
-    echo "Running bitbake -e $1"
-    BITBAKE_E="`bitbake -e $1`"
-    OECORE_NATIVE_SYSROOT=`echo "$BITBAKE_E" | grep ^STAGING_DIR_NATIVE= | cut -d '"' -f2`
-
-    if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then
-        # This indicates that there was an error running bitbake -e that
-        # the user needs to be informed of
-        echo "There was an error running bitbake to determine STAGING_DIR_NATIVE"
-        echo "Here is the output from bitbake -e $1"
-        echo $BITBAKE_E
-        exit 1
-    fi
+    echo "Getting sysroot..."
+    OECORE_NATIVE_SYSROOT=$(bitbake-getvar -r $1 --value STAGING_DIR_NATIVE)
 }
 
 if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then