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>
return 1
fi
fi
+ if [ "x$2" != "x" ]; then
+ BITBAKEDIR="$2"
+ fi
fi
if expr "$BDIR" : '/.*' > /dev/null ; then
BUILDDIR="$BDIR"
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"`