[OE-core] [PATCH 2/3] oe-buildenv-internal: Only add to $PATH if needed

Chris Larson clarson at kergoth.com
Mon Apr 8 22:40:24 UTC 2013


On Mon, Apr 8, 2013 at 10:48 AM, Paul Eggleton <
paul.eggleton at linux.intel.com> wrote:

> On Monday 08 April 2013 13:31:50 Trevor Woerner wrote:
> > On Fri, Apr 5, 2013 at 12:59 PM, Peter Kjellerstedt
> > <peter.kjellerstedt at axis.com> wrote:
> > > +[ "${PATH#$NEWPATHS}" != "$PATH" ] || PATH="$NEWPATHS$PATH"
> >
> > This is certainly a welcome addition in functionality, but it relies
> > on the pattern remaining at the start of the PATH (i.e. the user
> > hasn't played with PATH in any way). Could we not use the
> > ${parameter/pattern/string} parameter expansion instead (e.g.
> > "${PATH/$NEWPATHS/}") so it doesn't matter whether the user has
> > further modified the PATH?
>
> Unfortunately I think this is specific to bash, so it may not be portable.
> Maybe the equivalent can be achieved with sed however.


Also, neither version matches the : separator, which means we could in
theory get false positive matches.
-- 
Christopher Larson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20130408/bcb4a21d/attachment-0002.html>


More information about the Openembedded-core mailing list