[oe-commits] [openembedded-core] 65/82: oe-buildenv-internal: Add paths to $PATH individually

git at git.openembedded.org git at git.openembedded.org
Sun Mar 20 07:53:15 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit eb86006500c5d1a7605bf8b0340d728f11c9a5f4
Author: Peter Kjellerstedt <pkj at axis.com>
AuthorDate: Tue Mar 15 17:48:53 2016 +0100

    oe-buildenv-internal: Add paths to $PATH individually
    
    Instead of assuming that the path to the scripts directory always is
    in $PATH directly before the bitbake directory, treat them as separate
    paths and add them individually to $PATH.
    
    Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt at axis.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 scripts/oe-buildenv-internal | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-internal
index 457763b..85f82f1 100755
--- a/scripts/oe-buildenv-internal
+++ b/scripts/oe-buildenv-internal
@@ -95,9 +95,14 @@ if ! (test -d "$BITBAKEDIR"); then
 fi
 
 # Make sure our paths are at the beginning of $PATH
-NEWPATHS="${OEROOT}/scripts:$BITBAKEDIR/bin:"
-PATH=$NEWPATHS$(echo $PATH | sed -e "s|:$NEWPATHS|:|g" -e "s|^$NEWPATHS||")
-unset BITBAKEDIR NEWPATHS
+for newpath in "$BITBAKEDIR/bin" "$OEROOT/scripts"; do
+    # Remove any existences of $newpath from $PATH
+    PATH=$(echo $PATH | sed -re "s#(^|:)$newpath(:|$)#\1#g;s#^:##")
+
+    # Add $newpath to $PATH
+    PATH="$newpath:$PATH"
+done
+unset BITBAKEDIR newpath
 
 # Used by the runqemu script
 export BUILDDIR

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list