summaryrefslogtreecommitdiff
path: root/scripts/oe-buildenv-internal
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2013-04-05 18:59:45 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-04-08 22:37:22 +0100
commit161abcd3672f83990ede03d67b7388678c07150e (patch)
tree9bd380b1b26b10e2a13f37912bb240feee1e316c /scripts/oe-buildenv-internal
parentb458309845185a3cd473daa0969ce17e2ff5c602 (diff)
downloadopenembedded-core-161abcd3672f83990ede03d67b7388678c07150e.tar.gz
openembedded-core-161abcd3672f83990ede03d67b7388678c07150e.tar.bz2
openembedded-core-161abcd3672f83990ede03d67b7388678c07150e.zip
oe-buildenv-internal: Only add to $PATH if needed
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>
Diffstat (limited to 'scripts/oe-buildenv-internal')
-rwxr-xr-xscripts/oe-buildenv-internal5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-internal
index 0a4d3243d1..df953896f1 100755
--- a/scripts/oe-buildenv-internal
+++ b/scripts/oe-buildenv-internal
@@ -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