diff options
author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2013-04-09 12:24:13 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-04-09 13:16:53 +0100 |
commit | 977ea67ea58cbab244668c93c8df5ea73b1361e5 (patch) | |
tree | bee42d49fd1fe271097714fc930921428c08032c /scripts | |
parent | 42a72b1089b9eb8000941769d3d79c8b142b1ad7 (diff) | |
download | poky-977ea67ea58cbab244668c93c8df5ea73b1361e5.tar.gz |
oe-buildenv-internal: Only add to $PATH if needed
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.
(From OE-Core rev: 7429db6f38e405774ba66b3fa1bc3ac4b74ae6b9)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-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 df953896f1..644df8f30c 100755 --- a/scripts/oe-buildenv-internal +++ b/scripts/oe-buildenv-internal | |||
@@ -74,8 +74,9 @@ if ! (test -d "$BITBAKEDIR"); then | |||
74 | return 1 | 74 | return 1 |
75 | fi | 75 | fi |
76 | 76 | ||
77 | NEWPATHS="${OEROOT}/scripts:$BITBAKEDIR/bin/:" | 77 | # Make sure our paths are at the beginning of $PATH |
78 | [ "${PATH#$NEWPATHS}" != "$PATH" ] || PATH="$NEWPATHS$PATH" | 78 | NEWPATHS="${OEROOT}/scripts:$BITBAKEDIR/bin:" |
79 | PATH=$NEWPATHS$(echo $PATH | sed -e "s|:$NEWPATHS|:|g" -e "s|^$NEWPATHS||") | ||
79 | unset BITBAKEDIR NEWPATHS | 80 | unset BITBAKEDIR NEWPATHS |
80 | 81 | ||
81 | # Used by the runqemu script | 82 | # Used by the runqemu script |