oe-init-build-env: fix for build dirs that have spaces in their path

Enclose expansions of BUILDDIR in quotes in order to correctly handle paths
which include spaces.

(From OE-Core rev: 0c08723cf5ebc1a7df7dc4ca36cffa090286468c)

Signed-off-by: Joshua Lock <joshua.lock@collabora.co.uk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Joshua Lock 2015-04-13 16:30:02 +01:00 committed by Richard Purdie
parent 0fa5b047cc
commit 42131b6250
2 changed files with 6 additions and 6 deletions

View File

@ -46,7 +46,7 @@ OEROOT=`readlink -f "$OEROOT"`
export OEROOT export OEROOT
. $OEROOT/scripts/oe-buildenv-internal && \ . $OEROOT/scripts/oe-buildenv-internal && \
$OEROOT/scripts/oe-setup-builddir && \ $OEROOT/scripts/oe-setup-builddir && \
[ -n "$BUILDDIR" ] && cd $BUILDDIR [ -n "$BUILDDIR" ] && cd "$BUILDDIR"
unset OEROOT unset OEROOT
unset BBPATH unset BBPATH
unset THIS_SCRIPT unset THIS_SCRIPT

View File

@ -23,7 +23,7 @@ if [ -z "$BUILDDIR" ]; then
exit 1 exit 1
fi fi
mkdir -p $BUILDDIR/conf mkdir -p "$BUILDDIR/conf"
if [ ! -d "$BUILDDIR" ]; then if [ ! -d "$BUILDDIR" ]; then
echo >&2 "Error: The builddir ($BUILDDIR) does not exist!" echo >&2 "Error: The builddir ($BUILDDIR) does not exist!"
@ -38,13 +38,13 @@ fi
cd "$BUILDDIR" cd "$BUILDDIR"
if [ -f "$BUILDDIR/conf/templateconf.cfg" ]; then if [ -f "$BUILDDIR/conf/templateconf.cfg" ]; then
TEMPLATECONF=$(cat $BUILDDIR/conf/templateconf.cfg) TEMPLATECONF=$(cat "$BUILDDIR/conf/templateconf.cfg")
fi fi
. $OEROOT/.templateconf . $OEROOT/.templateconf
if [ ! -f "$BUILDDIR/conf/templateconf.cfg" ]; then if [ ! -f "$BUILDDIR/conf/templateconf.cfg" ]; then
echo "$TEMPLATECONF" >$BUILDDIR/conf/templateconf.cfg echo "$TEMPLATECONF" >"$BUILDDIR/conf/templateconf.cfg"
fi fi
# #
@ -79,7 +79,7 @@ advantage of multiple cores for example. See the file for more information as
common configuration options are commented. common configuration options are commented.
EOM EOM
cp -f $OECORELOCALCONF $BUILDDIR/conf/local.conf cp -f $OECORELOCALCONF "$BUILDDIR/conf/local.conf"
SHOWYPDOC=yes SHOWYPDOC=yes
fi fi
@ -100,7 +100,7 @@ EOM
# to replace it for compatibility. # to replace it for compatibility.
sed -e "s|##OEROOT##|$OEROOT|g" \ sed -e "s|##OEROOT##|$OEROOT|g" \
-e "s|##COREBASE##|$OEROOT|g" \ -e "s|##COREBASE##|$OEROOT|g" \
$OECORELAYERCONF > $BUILDDIR/conf/bblayers.conf $OECORELAYERCONF > "$BUILDDIR/conf/bblayers.conf"
SHOWYPDOC=yes SHOWYPDOC=yes
fi fi