First strip $PATH of any existence of the paths needed by Open Embedded
and BitBake. Then add the needed paths at the beginning. This makes sure
the needed paths are searched first, without growing $PATH unnecessarily
if oe-init-build-env is rerun for a directory for which it has
previously been run.

Signed-off-by: Peter Kjellerstedt <peter.kjellerst...@axis.com>
---
 scripts/oe-buildenv-internal | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-internal
index 0a4d324..644df8f 100755
--- a/scripts/oe-buildenv-internal
+++ b/scripts/oe-buildenv-internal
@@ -74,8 +74,10 @@ if ! (test -d "$BITBAKEDIR"); then
     return 1
 fi
 
-PATH="${OEROOT}/scripts:$BITBAKEDIR/bin/:$PATH"
-unset BITBAKEDIR
+# Make sure our paths are at the beginning of $PATH
+NEWPATHS="${OEROOT}/scripts:$BITBAKEDIR/bin:"
+PATH=$NEWPATHS$(echo $PATH | sed -e "s|:$NEWPATHS|:|g" -e "s|^$NEWPATHS||")
+unset BITBAKEDIR NEWPATHS
 
 # Used by the runqemu script
 export BUILDDIR
-- 
1.7.11.7


_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Reply via email to