Skip to content
Commit 3405a322 authored by Chen Qi's avatar Chen Qi Committed by Richard Purdie
Browse files

oe-buildenv-internal: remove path from previous project



Util now, only paths added for current project are removed
to avoid PATH growing unnecessarily. This is to handle the case
of sourcing the init script into different build directories.

However, if we source the init script from different projects into
different build directories, the paths added by previous projects
are not cleaned up.

To avoid this, we record the paths added into OE_ADDED_PATHS, and
remove it in the next sourcing.

The OE_ADDED_PATHS variable is exported mainly for the two reasons:
1. users can clearly see it in the `env' command's output.
2. if the prefixed PATH is carried into the subprocess (e.g., a subshell),
   so should this OE_ADDED_PATHS variable that prefixes it.

Note that the paths, "$OEROOT/scripts:$BITBAKEDIR/bin:", are added
as a whole. A previous commit, "oe-buildenv-internal: Add paths to $PATH individually",
made the change to treat these two paths separately, the reason was
not "assuming the path to the scripts directory always is in $PATH
directly before the bitbake directory". But this is exactly the effect
of the codes. I see no reason why we should complicate things.

Signed-off-by: default avatarChen Qi <Qi.Chen@windriver.com>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 09ac5645
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment