]> code.ossystems Code Review - openembedded-core.git/commitdiff
oe-buildenv-internal: Fix BITBAKEDIR changes to work with existing autobuilder scritpts
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 12 May 2012 07:41:44 +0000 (08:41 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 12 May 2012 07:41:50 +0000 (08:41 +0100)
The BITBAKEDIR change does not work well when the script is sourced from another script
since $2 may be unrelated. This change adds the logic onto the BDIR conditional and
which more external scripts would set, hence avoiding the problem.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/oe-buildenv-internal

index 05c6cd8ce157e8a107355975736141c2b6e760d0..32c0ba02d6202fb1f068f009cb89bd3da773320b 100755 (executable)
@@ -46,6 +46,9 @@ if [ "x$BDIR" = "x" ]; then
             return 1
         fi
     fi
+    if [ "x$2" != "x" ]; then
+        BITBAKEDIR="$2"
+    fi
 fi
 if expr "$BDIR" : '/.*' > /dev/null ; then
     BUILDDIR="$BDIR"
@@ -54,10 +57,8 @@ else
 fi
 unset BDIR
 
-if [ "x$2" = "x" ]; then
+if [ "x$BITBAKEDIR" = "x" ]; then
     BITBAKEDIR="$OEROOT/bitbake$BBEXTRA/"
-else
-    BITBAKEDIR="$2"
 fi
 
 BITBAKEDIR=`readlink -f "$BITBAKEDIR"`