[OE-core] [PATCHv2 4/7] oe-init-build-env*: Make them actually return failures

Peter Kjellerstedt peter.kjellerstedt at axis.com
Thu Mar 17 11:14:11 UTC 2016


If either of the internal scripts (oe-buildenv-internal and
oe-setup-builddir) failed, oe-init-build-env (and
oe-init-build-env-memres) would still return success.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt at axis.com>
---
 oe-init-build-env        | 10 +++++++---
 oe-init-build-env-memres | 10 +++++++---
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/oe-init-build-env b/oe-init-build-env
index 0b4df1b..5fe68d1 100755
--- a/oe-init-build-env
+++ b/oe-init-build-env
@@ -48,11 +48,15 @@ fi
 unset THIS_SCRIPT
 
 export OEROOT
-. $OEROOT/scripts/oe-buildenv-internal && \
-    TEMPLATECONF="$TEMPLATECONF" $OEROOT/scripts/oe-setup-builddir && \
-    [ -n "$BUILDDIR" ] && cd "$BUILDDIR"
+. $OEROOT/scripts/oe-buildenv-internal &&
+    TEMPLATECONF="$TEMPLATECONF" $OEROOT/scripts/oe-setup-builddir || {
+    unset OEROOT
+    return 1
+}
 unset OEROOT
 
+[ -z "$BUILDDIR" ] || cd "$BUILDDIR"
+
 # Shutdown any bitbake server if the BBSERVER variable is not set
 if [ -z "$BBSERVER" ] && [ -f bitbake.lock ]; then
     grep ":" bitbake.lock > /dev/null && BBSERVER=$(cat bitbake.lock) bitbake --status-only
diff --git a/oe-init-build-env-memres b/oe-init-build-env-memres
index 9d393f5..9e1425e 100755
--- a/oe-init-build-env-memres
+++ b/oe-init-build-env-memres
@@ -56,11 +56,15 @@ fi
 unset THIS_SCRIPT
 
 export OEROOT
-. $OEROOT/scripts/oe-buildenv-internal && \
-    TEMPLATECONF="$TEMPLATECONF" $OEROOT/scripts/oe-setup-builddir && \
-    [ -n "$BUILDDIR" ] && cd "$BUILDDIR"
+. $OEROOT/scripts/oe-buildenv-internal &&
+    TEMPLATECONF="$TEMPLATECONF" $OEROOT/scripts/oe-setup-builddir || {
+    unset OEROOT
+    return 1
+}
 unset OEROOT
 
+[ -z "$BUILDDIR" ] || cd "$BUILDDIR"
+
 res=1
 if [ -e bitbake.lock ] && grep : bitbake.lock > /dev/null; then
     BBSERVER=$(cat bitbake.lock) bitbake --status-only
-- 
2.1.0




More information about the Openembedded-core mailing list