summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xoe-init-build-env21
-rwxr-xr-xoe-init-build-env-memres30
2 files changed, 25 insertions, 26 deletions
diff --git a/oe-init-build-env b/oe-init-build-env
index fa9eacd890..0b4df1b2dc 100755
--- a/oe-init-build-env
+++ b/oe-init-build-env
@@ -33,12 +33,12 @@ else
33 THIS_SCRIPT="$(pwd)/oe-init-build-env" 33 THIS_SCRIPT="$(pwd)/oe-init-build-env"
34fi 34fi
35if [ -n "$BBSERVER" ]; then 35if [ -n "$BBSERVER" ]; then
36 unset BBSERVER 36 unset BBSERVER
37fi 37fi
38 38
39if [ -z "$ZSH_NAME" ] && [ "$0" = "$THIS_SCRIPT" ]; then 39if [ -z "$ZSH_NAME" ] && [ "$0" = "$THIS_SCRIPT" ]; then
40 echo "Error: This script needs to be sourced. Please run as '. $THIS_SCRIPT'" 40 echo "Error: This script needs to be sourced. Please run as '. $THIS_SCRIPT'"
41 exit 1 41 exit 1
42fi 42fi
43 43
44if [ -z "$OEROOT" ]; then 44if [ -z "$OEROOT" ]; then
@@ -49,16 +49,15 @@ unset THIS_SCRIPT
49 49
50export OEROOT 50export OEROOT
51. $OEROOT/scripts/oe-buildenv-internal && \ 51. $OEROOT/scripts/oe-buildenv-internal && \
52 TEMPLATECONF="$TEMPLATECONF" $OEROOT/scripts/oe-setup-builddir && \ 52 TEMPLATECONF="$TEMPLATECONF" $OEROOT/scripts/oe-setup-builddir && \
53 [ -n "$BUILDDIR" ] && cd "$BUILDDIR" 53 [ -n "$BUILDDIR" ] && cd "$BUILDDIR"
54unset OEROOT 54unset OEROOT
55 55
56# Shutdown any bitbake server if the BBSERVER variable is not set 56# Shutdown any bitbake server if the BBSERVER variable is not set
57if [ -z "$BBSERVER" ] && [ -f bitbake.lock ] ; then 57if [ -z "$BBSERVER" ] && [ -f bitbake.lock ]; then
58 grep ":" bitbake.lock > /dev/null && BBSERVER=`cat bitbake.lock` bitbake --status-only 58 grep ":" bitbake.lock > /dev/null && BBSERVER=$(cat bitbake.lock) bitbake --status-only
59 if [ $? = 0 ] ; then 59 if [ $? = 0 ]; then
60 echo "Shutting down bitbake memory resident server with bitbake -m" 60 echo "Shutting down bitbake memory resident server with bitbake -m"
61 BBSERVER=`cat bitbake.lock` bitbake -m 61 BBSERVER=$(cat bitbake.lock) bitbake -m
62 fi 62 fi
63fi 63fi
64
diff --git a/oe-init-build-env-memres b/oe-init-build-env-memres
index 41c09d80d0..9d393f5812 100755
--- a/oe-init-build-env-memres
+++ b/oe-init-build-env-memres
@@ -41,12 +41,12 @@ else
41 THIS_SCRIPT="$(pwd)/oe-init-build-env" 41 THIS_SCRIPT="$(pwd)/oe-init-build-env"
42fi 42fi
43if [ -n "$BBSERVER" ]; then 43if [ -n "$BBSERVER" ]; then
44 unset BBSERVER 44 unset BBSERVER
45fi 45fi
46 46
47if [ -z "$ZSH_NAME" ] && [ "x$0" = "x$THIS_SCRIPT" ]; then 47if [ -z "$ZSH_NAME" ] && [ "$0" = "$THIS_SCRIPT" ]; then
48 echo "Error: This script needs to be sourced. Please run as '. $THIS_SCRIPT'" 48 echo "Error: This script needs to be sourced. Please run as '. $THIS_SCRIPT'"
49 exit 1 49 exit 1
50fi 50fi
51 51
52if [ -z "$OEROOT" ]; then 52if [ -z "$OEROOT" ]; then
@@ -57,30 +57,30 @@ unset THIS_SCRIPT
57 57
58export OEROOT 58export OEROOT
59. $OEROOT/scripts/oe-buildenv-internal && \ 59. $OEROOT/scripts/oe-buildenv-internal && \
60 $OEROOT/scripts/oe-setup-builddir && \ 60 TEMPLATECONF="$TEMPLATECONF" $OEROOT/scripts/oe-setup-builddir && \
61 [ -n "$BUILDDIR" ] && cd $BUILDDIR 61 [ -n "$BUILDDIR" ] && cd "$BUILDDIR"
62unset OEROOT 62unset OEROOT
63 63
64res=1 64res=1
65if [ -e bitbake.lock ] && grep : bitbake.lock > /dev/null ; then 65if [ -e bitbake.lock ] && grep : bitbake.lock > /dev/null; then
66 BBSERVER=`cat bitbake.lock` bitbake --status-only 66 BBSERVER=$(cat bitbake.lock) bitbake --status-only
67 res=$? 67 res=$?
68fi 68fi
69 69
70if [ $res != 0 ] ; then 70if [ $res != 0 ]; then
71 bitbake --server-only -t xmlrpc -B localhost:$port 71 bitbake --server-only -t xmlrpc -B localhost:$port
72fi 72fi
73 73
74if [ $port = -1 ] ; then 74if [ $port = -1 ]; then
75 export BBSERVER=localhost:-1 75 export BBSERVER=localhost:-1
76 echo "Bitbake server started on demand as needed, use bitbake -m to shut it down" 76 echo "Bitbake server started on demand as needed, use bitbake -m to shut it down"
77else 77else
78 export BBSERVER=`cat bitbake.lock` 78 export BBSERVER=$(cat bitbake.lock)
79 79
80 if [ $res = 0 ] ; then 80 if [ $res = 0 ]; then
81 echo "Using existing bitbake server at: $BBSERVER, use bitbake -m to shut it down" 81 echo "Using existing bitbake server at: $BBSERVER, use bitbake -m to shut it down"
82 else 82 else
83 echo "Bitbake server started at: $BBSERVER, use bitbake -m to shut it down" 83 echo "Bitbake server started at: $BBSERVER, use bitbake -m to shut it down"
84 fi 84 fi
85 unset res
86fi 85fi
86unset port res