[bitbake-devel] [PATCH 2/2] bitbake-user-manual: immediate-variable-expansion: Correct description
Jacob Kroon
jacob.kroon at gmail.com
Wed Mar 18 23:17:37 UTC 2020
References to undefined variables are preserved as is and do not
expand to nothing as in GNU Make.
Signed-off-by: Jacob Kroon <jacob.kroon at gmail.com>
---
.../bitbake-user-manual-metadata.xml | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml b/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml
index bb5a7f86..10b58835 100644
--- a/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml
+++ b/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml
@@ -294,17 +294,20 @@
rather than when the variable is actually used:
<literallayout class='monospaced'>
T = "123"
- A := "${B} ${A} test ${T}"
+ A := "test ${T}"
T = "456"
- B = "${T} bval"
+ B := "${T} ${C}"
C = "cval"
C := "${C}append"
</literallayout>
In this example, <filename>A</filename> contains
- "test 123" because <filename>${B}</filename> and
- <filename>${A}</filename> at the time of parsing are undefined,
- which leaves "test 123".
- And, the variable <filename>C</filename>
+ "test 123", even though the final value of <filename>T</filename>
+ is "456".
+ The variable <filename>B</filename> will end up containing "456 cvalappend".
+ This is because references to undefined variables are preserved as is
+ during (immediate)expansion. This is in contrast to GNU Make, where undefined
+ variables expand to nothing.
+ The variable <filename>C</filename>
contains "cvalappend" since <filename>${C}</filename> immediately
expands to "cval".
</para>
--
2.25.1
More information about the bitbake-devel
mailing list