All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts/runqemu: grep for line beginning with TMPDIR
@ 2011-08-02  1:47 Khem Raj
  2011-08-02 11:43 ` Richard Purdie
  0 siblings, 1 reply; 2+ messages in thread
From: Khem Raj @ 2011-08-02  1:47 UTC (permalink / raw)
  To: openembedded-core

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>
---
 scripts/runqemu |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index dacaf7c..9611c64 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -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"
-- 
1.7.4.1




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] scripts/runqemu: grep for line beginning with TMPDIR
  2011-08-02  1:47 [PATCH] scripts/runqemu: grep for line beginning with TMPDIR Khem Raj
@ 2011-08-02 11:43 ` Richard Purdie
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Purdie @ 2011-08-02 11:43 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Mon, 2011-08-01 at 18:47 -0700, Khem Raj wrote:
> 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

Merged to master, thanks.

Richard




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-02 11:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-02  1:47 [PATCH] scripts/runqemu: grep for line beginning with TMPDIR Khem Raj
2011-08-02 11:43 ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.