]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts/runqemu: grep for line beginning with TMPDIR
authorKhem Raj <raj.khem@gmail.com>
Tue, 2 Aug 2011 01:47:13 +0000 (18:47 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 2 Aug 2011 11:43:05 +0000 (12:43 +0100)
Currently the grep regexp matches any occurance of
'TMPDIR=' but if you have another variable defined
e.g. OE_BUILD_TMPDIR=xxx then that gets picked up
too.

$ bitbake -e | grep TMPDIR=\"
TMPDIR="/home/kraj/work/angstrom/build/tmp-angstrom_2010_x-eglibc"
OE_BUILD_TMPDIR="/home/kraj/work/angstrom/build/tmp-angstrom_2010_x"

So we become a bit more stringent and look for
line starting with TMPDIR

$ bitbake -e | grep ^TMPDIR=\"
TMPDIR="/home/kraj/work/angstrom/build/tmp-angstrom_2010_x-eglibc"

make sure that it greps
only TMPDIR=xxx occurance and not values of other variables
whose names happens to end with TMPDIR

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/runqemu

index dacaf7caac1541b9f234bc4b3ac3158aca8e2027..9611c6412e5b831d535c82c519e261ac387abdfe 100755 (executable)
@@ -271,7 +271,7 @@ setup_tmpdir() {
             exit 1; }
 
         # We have bitbake in PATH, get TMPDIR from bitbake
-        TMPDIR=`bitbake -e | grep TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
+        TMPDIR=`bitbake -e | grep ^TMPDIR=\" | cut -d '=' -f2 | cut -d '"' -f2`
         if [ -z "$TMPDIR" ]; then
             echo "Error: this script needs to be run from your build directory,"
             echo "or you need to explicitly set TMPDIR in your environment"