[oe-commits] Peter Kjellerstedt : oe-buildenv-internal: Only add to $PATH if needed
git at git.openembedded.org
git at git.openembedded.org
Tue Apr 9 12:16:51 UTC 2013
Module: openembedded-core.git
Branch: master
Commit: 161abcd3672f83990ede03d67b7388678c07150e
URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=161abcd3672f83990ede03d67b7388678c07150e
Author: Peter Kjellerstedt <peter.kjellerstedt at axis.com>
Date: Fri Apr 5 18:59:45 2013 +0200
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 at axis.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
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 0a4d324..df95389 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
More information about the Openembedded-commits
mailing list