oe-find-native-sysroot: show bitbake errors to user

Ran into another bug that was masked by hiding a bitbake error message.
This catches this situation and displays the error to the user.

Also includes whitespace fixes.

(From OE-Core rev: 435ffeefe4a1df53335fd397ff404bed7deae2df)

Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Scott Garman 2012-09-26 11:02:26 -07:00 committed by Richard Purdie
parent 71c0ff2e1b
commit f31d114b48
1 changed files with 19 additions and 10 deletions

View File

@ -30,7 +30,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
if [ -z "$OECORE_NATIVE_SYSROOT" ]; then
if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then
BITBAKE=`which bitbake 2> /dev/null`
if [ "x$BITBAKE" != "x" ]; then
if [ "$UID" = "0" ]; then
@ -46,7 +46,7 @@ if [ -z "$OECORE_NATIVE_SYSROOT" ]; then
OECORE_NATIVE_SYSROOT=`bitbake -e | grep ^STAGING_DIR_NATIVE | cut -d '=' -f2 | cut -d '"' -f2`
fi
else
echo "Error: Unable to locate your native sysroot."
echo "Error: Unable to locate bitbake command."
echo "Did you forget to source the build environment setup script?"
if [ -z "$SKIP_STRICT_SYSROOT_CHECK" ]; then
@ -55,6 +55,15 @@ if [ -z "$OECORE_NATIVE_SYSROOT" ]; then
fi
fi
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"
bitbake -e
exit 1
fi
# Set up pseudo command
if [ ! -e "$OECORE_NATIVE_SYSROOT/usr/bin/pseudo" ]; then
echo "Error: Unable to find pseudo binary in $OECORE_NATIVE_SYSROOT/usr/bin/"