From 57044b9a6240235a403eac4067e2e2113e03b6eb Mon Sep 17 00:00:00 2001 From: Chris Larson Date: Thu, 25 Feb 2010 09:42:28 -0700 Subject: 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 Signed-off-by: Richard Purdie --- bitbake/doc/manual/usermanual.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'bitbake/doc') 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.
Setting a default value (?=) A ?= "aval" - If A is set before the above is called, it will retain it's previous value. If A is unset prior to the above call, A will be set to aval. + If A is set before the above is called, it will retain it's previous value. If A is unset prior to the above call, A will be set to aval. Note that this assignment is immediate, so if there are multiple ?= assignments to a single variable, the first of those will be used. +
+
+ Setting a default value (??=) + A ??= "somevalue" + A ??= "someothervalue" + If A is set before the above, it will retain that value. If A is unset prior to the above, A will be set to someothervalue. 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.
Immediate variable expansion (:=) -- cgit v1.2.3-54-g00ecf