[yocto] which yocto doc explains bitbake assignment variations?
Rudolf Streif
rudolf.streif at linux.com
Thu Mar 29 20:12:34 PDT 2012
1. yes, = will always override any prior ?= or ??= and any subsequent ?= or
??= will not change the setting anymore.
2. yes, a ?= following a ??= will set the variable. Only a = will be
override the setting of the ?=. Any following ?= and ??= will not change
the setting.
3. yes, a ?= or = following a ??= will set the variable.
Just try it. Put a variable (FOO) in local.conf and use bitbake -e | grep
FOO
FOO ??= "bar"
FOO ?= "barbar"
:rjs
On Thu, Mar 29, 2012 at 3:34 PM, Robert P. J. Day <rpjday at crashcourse.ca>wrote:
>
> just to be absolutely clear so i don't misunderstand:
>
> On Thu, 29 Mar 2012, Rudolf Streif wrote:
>
> > VAR = "value"
> >
> > In this example, VAR is set to value.
>
> so the "=" assignment will *always* set the variable to that value,
> regardless of what combination of =, ?= or ??= has come before it,
> correct?
>
> > Early Default Value Assignment (?=)
> >
> > A variable can be early-assigned a default value using
> the ?= assignment operator:
> >
> > A ?= "1"
> > B ?= "2"
> > B ?= "3"
> >
> > In this example A will contain 1 if it was not previously
> set. B will contain 2 because
> > the ?= assignment operator is immediate meaning that if there are
> multiple ?= assignments
> > to a single variable, the first one will be used.
>
> and the first ?= will be processed, even if there were earlier ??=
> assignments, correct? (obviously not if there were earlier =
> assignments.)
>
> > A ??= "1"
> > B ??= "2"
> > B ??= "3"
> >
> > In this example A will contain 1 if it was not previously
> set. B will contain 3 because
> > the ??= assignment operator is a late or lazy assignment operator
> and assignment will not
> > take place until the end of the parsing process. If there are
> multiple ??= assignments to a
> > single variable, the last one will be used.
>
> however, this "weak" assignment is cancelled by the appearance of
> either a = or a ?= assignment at any time, yes?
>
> rday
>
> --
>
> ========================================================================
> Robert P. J. Day Ottawa, Ontario, CANADA
> http://crashcourse.ca
>
> Twitter: http://twitter.com/rpjday
> LinkedIn: http://ca.linkedin.com/in/rpjday
> ========================================================================
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20120329/f5090fe0/attachment.html>
More information about the yocto
mailing list