]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts/bitbake: ensure user is in build directory
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Tue, 13 Mar 2012 12:38:04 +0000 (12:38 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 14 Mar 2012 13:12:42 +0000 (13:12 +0000)
If the user is in any directory other than $BUILDDIR when the bitbake
wrapper script is run, then show an error an exit.

Fixes [YOCTO #2071].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
scripts/bitbake

index dda3b261de8b05aaf6581d0b30247a04b04e012c..45c869799d5630099d2bd8e43c9624469438e786 100755 (executable)
@@ -47,6 +47,11 @@ float_test() {
 # but earlier versions do not
 float_test "$TARVERSION > 1.23" && needtar="0"
 
+if [ "`pwd`" != "$BUILDDIR" ] ; then
+    echo "BitBake must be run from your build directory: $BUILDDIR"
+    exit 1
+fi
+
 buildpseudo="1"
 if [ $needpseudo = "1" ] && [ -e "$BUILDDIR/pseudodone" ]; then
     PSEUDOBINDIR=`cat $BUILDDIR/pseudodone`