From 161abcd3672f83990ede03d67b7388678c07150e Mon Sep 17 00:00:00 2001 From: Peter Kjellerstedt Date: Fri, 5 Apr 2013 18:59:45 +0200 Subject: 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 Signed-off-by: Richard Purdie --- scripts/oe-buildenv-internal | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') 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 -- cgit v1.2.3