diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-02-25 09:42:28 -0700 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-03-22 15:02:59 +0000 |
commit | 57044b9a6240235a403eac4067e2e2113e03b6eb (patch) | |
tree | 46f15cb768778aa0f8363d6da2e98c6aaa69aadb /bitbake/doc/manual | |
parent | ada2a8494a88b59de25c0a44fce30190f560eff4 (diff) | |
download | poky-57044b9a6240235a403eac4067e2e2113e03b6eb.tar.gz |
Implement ??= operator
??= is a lazy, conditional assignment. Whereas a ?= immediately assigns to
the variable if the variable has not yet been set, ??= does not apply the
default assignment until the end of the parse. As a result, the final ??= for
a given variable is used, as opposed to the first as in ?=.
Note that the initial implementation relies upon finalise() to apply the
defaults, so a "bitbake -e" without specifying a recipe will not show the
defaults as set by ??=. Moving application of the default into getVar adds
too large a performance hit. We may want to revisit this later.
(Bitbake rev: 74f50fbca194c9c72bd2a540f4b9de458cb08e2d)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/doc/manual')
-rw-r--r-- | bitbake/doc/manual/usermanual.xml | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bitbake/doc/manual/usermanual.xml b/bitbake/doc/manual/usermanual.xml index c3403449fe..450ac77d7a 100644 --- a/bitbake/doc/manual/usermanual.xml +++ b/bitbake/doc/manual/usermanual.xml | |||
@@ -91,7 +91,13 @@ share common metadata between many packages.</para></listitem> | |||
91 | <section> | 91 | <section> |
92 | <title>Setting a default value (?=)</title> | 92 | <title>Setting a default value (?=)</title> |
93 | <para><screen><varname>A</varname> ?= "aval"</screen></para> | 93 | <para><screen><varname>A</varname> ?= "aval"</screen></para> |
94 | <para>If <varname>A</varname> is set before the above is called, it will retain it's previous value. If <varname>A</varname> is unset prior to the above call, <varname>A</varname> will be set to <literal>aval</literal>.</para> | 94 | <para>If <varname>A</varname> is set before the above is called, it will retain it's previous value. If <varname>A</varname> is unset prior to the above call, <varname>A</varname> will be set to <literal>aval</literal>. Note that this assignment is immediate, so if there are multiple ?= assignments to a single variable, the first of those will be used.</para> |
95 | </section> | ||
96 | <section> | ||
97 | <title>Setting a default value (??=)</title> | ||
98 | <para><screen><varname>A</varname> ??= "somevalue"</screen></para> | ||
99 | <para><screen><varname>A</varname> ??= "someothervalue"</screen></para> | ||
100 | <para>If <varname>A</varname> is set before the above, it will retain that value. If <varname>A</varname> is unset prior to the above, <varname>A</varname> will be set to <literal>someothervalue</literal>. This is a lazy version of ??=, in that the assignment does not occur until the end of the parsing process, so that the last, rather than the first, ??= assignment to a given variable will be used.</para> | ||
95 | </section> | 101 | </section> |
96 | <section> | 102 | <section> |
97 | <title>Immediate variable expansion (:=)</title> | 103 | <title>Immediate variable expansion (:=)</title> |