diff options
-rwxr-xr-x | oe-init-build-env | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/oe-init-build-env b/oe-init-build-env index 8ef32f3d55..52495133fd 100755 --- a/oe-init-build-env +++ b/oe-init-build-env | |||
@@ -25,27 +25,31 @@ | |||
25 | # being sourced. To workaround the shell limitation use "set arg1" prior | 25 | # being sourced. To workaround the shell limitation use "set arg1" prior |
26 | # to sourcing this script. | 26 | # to sourcing this script. |
27 | # | 27 | # |
28 | if [ -z "$ZSH_NAME" ] && [ "x$0" = "x./oe-init-build-env" ]; then | 28 | if [ -n "$BASH_SOURCE" ]; then |
29 | echo "Error: This script needs to be sourced. Please run as '. ./oe-init-build-env'" | 29 | OEROOT="`dirname $BASH_SOURCE`" |
30 | elif [ -n "$ZSH_NAME" ]; then | ||
31 | OEROOT="`dirname $0`" | ||
30 | else | 32 | else |
31 | if [ -n "$BASH_SOURCE" ]; then | 33 | OEROOT="`pwd`" |
32 | OEROOT="`dirname $BASH_SOURCE`" | ||
33 | elif [ -n "$ZSH_NAME" ]; then | ||
34 | OEROOT="`dirname $0`" | ||
35 | else | ||
36 | OEROOT="`pwd`" | ||
37 | fi | ||
38 | if [ -n "$BBSERVER" ]; then | ||
39 | unset BBSERVER | ||
40 | fi | ||
41 | OEROOT=`readlink -f "$OEROOT"` | ||
42 | export OEROOT | ||
43 | . $OEROOT/scripts/oe-buildenv-internal && \ | ||
44 | $OEROOT/scripts/oe-setup-builddir && \ | ||
45 | [ -n "$BUILDDIR" ] && cd $BUILDDIR | ||
46 | unset OEROOT | ||
47 | unset BBPATH | ||
48 | fi | 34 | fi |
35 | if [ -n "$BBSERVER" ]; then | ||
36 | unset BBSERVER | ||
37 | fi | ||
38 | THIS_SCRIPT=$OEROOT/oe-init-build-env | ||
39 | |||
40 | if [ -z "$ZSH_NAME" ] && [ "$0" = "$THIS_SCRIPT" ]; then | ||
41 | echo "Error: This script needs to be sourced. Please run as '. $THIS_SCRIPT'" | ||
42 | exit 1 | ||
43 | fi | ||
44 | |||
45 | OEROOT=`readlink -f "$OEROOT"` | ||
46 | export OEROOT | ||
47 | . $OEROOT/scripts/oe-buildenv-internal && \ | ||
48 | $OEROOT/scripts/oe-setup-builddir && \ | ||
49 | [ -n "$BUILDDIR" ] && cd $BUILDDIR | ||
50 | unset OEROOT | ||
51 | unset BBPATH | ||
52 | unset THIS_SCRIPT | ||
49 | 53 | ||
50 | # Shutdown any bitbake server if the BBSERVER variable is not set | 54 | # Shutdown any bitbake server if the BBSERVER variable is not set |
51 | if [ -z "$BBSERVER" ] && [ -f bitbake.lock ] ; then | 55 | if [ -z "$BBSERVER" ] && [ -f bitbake.lock ] ; then |