]> code.ossystems Code Review - openembedded-core.git/commitdiff
oe-buildenv-internal: Only add to $PATH if needed
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>
Fri, 5 Apr 2013 16:59:45 +0000 (18:59 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 8 Apr 2013 21:37:22 +0000 (22:37 +0100)
If $PATH already has the needed paths at the beginning, there is no need
to add them again. This allows rerunning oe-init-build-env for the same
directory without having $PATH increase unnecessarily every time.

Signed-off-by: Peter Kjellerstedt <pkj@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/oe-buildenv-internal

index 0a4d3243d19a528c99bb4202246c103f95857675..df953896f1cfb76a963a5ff4382b483b8efa83e5 100755 (executable)
@@ -74,8 +74,9 @@ if ! (test -d "$BITBAKEDIR"); then
     return 1
 fi
 
-PATH="${OEROOT}/scripts:$BITBAKEDIR/bin/:$PATH"
-unset BITBAKEDIR
+NEWPATHS="${OEROOT}/scripts:$BITBAKEDIR/bin/:"
+[ "${PATH#$NEWPATHS}" != "$PATH" ] || PATH="$NEWPATHS$PATH"
+unset BITBAKEDIR NEWPATHS
 
 # Used by the runqemu script
 export BUILDDIR