diff options
author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2013-04-05 18:59:45 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-04-08 22:37:22 +0100 |
commit | 161abcd3672f83990ede03d67b7388678c07150e (patch) | |
tree | 9bd380b1b26b10e2a13f37912bb240feee1e316c | |
parent | b458309845185a3cd473daa0969ce17e2ff5c602 (diff) | |
download | openembedded-core-contrib-161abcd3672f83990ede03d67b7388678c07150e.tar.gz |
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>
-rwxr-xr-x | scripts/oe-buildenv-internal | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-internal index 0a4d3243d19..df953896f1c 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 |