oe-init-build-env*: Remove unnecessary differences between the scripts
While at it, also fix: * consistent indentation (four spaces) * unset temporary variables * use $(...) instead of `...` (From OE-Core rev: 1295d413f27941d0763a3d58982378738bf3ca06) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
51aa00f0f8
commit
ea28de6d39
|
@ -33,12 +33,12 @@ else
|
||||||
THIS_SCRIPT="$(pwd)/oe-init-build-env"
|
THIS_SCRIPT="$(pwd)/oe-init-build-env"
|
||||||
fi
|
fi
|
||||||
if [ -n "$BBSERVER" ]; then
|
if [ -n "$BBSERVER" ]; then
|
||||||
unset BBSERVER
|
unset BBSERVER
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$ZSH_NAME" ] && [ "$0" = "$THIS_SCRIPT" ]; then
|
if [ -z "$ZSH_NAME" ] && [ "$0" = "$THIS_SCRIPT" ]; then
|
||||||
echo "Error: This script needs to be sourced. Please run as '. $THIS_SCRIPT'"
|
echo "Error: This script needs to be sourced. Please run as '. $THIS_SCRIPT'"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$OEROOT" ]; then
|
if [ -z "$OEROOT" ]; then
|
||||||
|
@ -49,16 +49,15 @@ unset THIS_SCRIPT
|
||||||
|
|
||||||
export OEROOT
|
export OEROOT
|
||||||
. $OEROOT/scripts/oe-buildenv-internal && \
|
. $OEROOT/scripts/oe-buildenv-internal && \
|
||||||
TEMPLATECONF="$TEMPLATECONF" $OEROOT/scripts/oe-setup-builddir && \
|
TEMPLATECONF="$TEMPLATECONF" $OEROOT/scripts/oe-setup-builddir && \
|
||||||
[ -n "$BUILDDIR" ] && cd "$BUILDDIR"
|
[ -n "$BUILDDIR" ] && cd "$BUILDDIR"
|
||||||
unset OEROOT
|
unset OEROOT
|
||||||
|
|
||||||
# Shutdown any bitbake server if the BBSERVER variable is not set
|
# Shutdown any bitbake server if the BBSERVER variable is not set
|
||||||
if [ -z "$BBSERVER" ] && [ -f bitbake.lock ] ; then
|
if [ -z "$BBSERVER" ] && [ -f bitbake.lock ]; then
|
||||||
grep ":" bitbake.lock > /dev/null && BBSERVER=`cat bitbake.lock` bitbake --status-only
|
grep ":" bitbake.lock > /dev/null && BBSERVER=$(cat bitbake.lock) bitbake --status-only
|
||||||
if [ $? = 0 ] ; then
|
if [ $? = 0 ]; then
|
||||||
echo "Shutting down bitbake memory resident server with bitbake -m"
|
echo "Shutting down bitbake memory resident server with bitbake -m"
|
||||||
BBSERVER=`cat bitbake.lock` bitbake -m
|
BBSERVER=$(cat bitbake.lock) bitbake -m
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -41,12 +41,12 @@ else
|
||||||
THIS_SCRIPT="$(pwd)/oe-init-build-env"
|
THIS_SCRIPT="$(pwd)/oe-init-build-env"
|
||||||
fi
|
fi
|
||||||
if [ -n "$BBSERVER" ]; then
|
if [ -n "$BBSERVER" ]; then
|
||||||
unset BBSERVER
|
unset BBSERVER
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$ZSH_NAME" ] && [ "x$0" = "x$THIS_SCRIPT" ]; then
|
if [ -z "$ZSH_NAME" ] && [ "$0" = "$THIS_SCRIPT" ]; then
|
||||||
echo "Error: This script needs to be sourced. Please run as '. $THIS_SCRIPT'"
|
echo "Error: This script needs to be sourced. Please run as '. $THIS_SCRIPT'"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$OEROOT" ]; then
|
if [ -z "$OEROOT" ]; then
|
||||||
|
@ -57,30 +57,30 @@ unset THIS_SCRIPT
|
||||||
|
|
||||||
export OEROOT
|
export OEROOT
|
||||||
. $OEROOT/scripts/oe-buildenv-internal && \
|
. $OEROOT/scripts/oe-buildenv-internal && \
|
||||||
$OEROOT/scripts/oe-setup-builddir && \
|
TEMPLATECONF="$TEMPLATECONF" $OEROOT/scripts/oe-setup-builddir && \
|
||||||
[ -n "$BUILDDIR" ] && cd $BUILDDIR
|
[ -n "$BUILDDIR" ] && cd "$BUILDDIR"
|
||||||
unset OEROOT
|
unset OEROOT
|
||||||
|
|
||||||
res=1
|
res=1
|
||||||
if [ -e bitbake.lock ] && grep : bitbake.lock > /dev/null ; then
|
if [ -e bitbake.lock ] && grep : bitbake.lock > /dev/null; then
|
||||||
BBSERVER=`cat bitbake.lock` bitbake --status-only
|
BBSERVER=$(cat bitbake.lock) bitbake --status-only
|
||||||
res=$?
|
res=$?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $res != 0 ] ; then
|
if [ $res != 0 ]; then
|
||||||
bitbake --server-only -t xmlrpc -B localhost:$port
|
bitbake --server-only -t xmlrpc -B localhost:$port
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $port = -1 ] ; then
|
if [ $port = -1 ]; then
|
||||||
export BBSERVER=localhost:-1
|
export BBSERVER=localhost:-1
|
||||||
echo "Bitbake server started on demand as needed, use bitbake -m to shut it down"
|
echo "Bitbake server started on demand as needed, use bitbake -m to shut it down"
|
||||||
else
|
else
|
||||||
export BBSERVER=`cat bitbake.lock`
|
export BBSERVER=$(cat bitbake.lock)
|
||||||
|
|
||||||
if [ $res = 0 ] ; then
|
if [ $res = 0 ]; then
|
||||||
echo "Using existing bitbake server at: $BBSERVER, use bitbake -m to shut it down"
|
echo "Using existing bitbake server at: $BBSERVER, use bitbake -m to shut it down"
|
||||||
else
|
else
|
||||||
echo "Bitbake server started at: $BBSERVER, use bitbake -m to shut it down"
|
echo "Bitbake server started at: $BBSERVER, use bitbake -m to shut it down"
|
||||||
fi
|
fi
|
||||||
unset res
|
|
||||||
fi
|
fi
|
||||||
|
unset port res
|
||||||
|
|
Loading…
Reference in New Issue