summaryrefslogtreecommitdiffstats
path: root/bitbake/doc
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2022-12-18 01:10:30 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-21 14:15:26 +0000
commit7ee2ee05723b1babbec326d7b381531c81f3c1fd (patch)
treea6db85f07e2700b70e7eb26159340c2587049704 /bitbake/doc
parent1628054eca82f3441cc119a8f741d00360171e77 (diff)
downloadpoky-7ee2ee05723b1babbec326d7b381531c81f3c1fd.tar.gz
bitbake: bitbake-user-manual: Document override :append, :prepend, :remove order
The application order of override syntax :append, :prepend, :remove is inobvious and undocumented. The order does not match variable parse history, i.e. output of "bitbake -e", either. Add note documenting the exact order in which :append, :prepend, :remove are applied to variable in lib/bb/data_smart.py getVarFlag(). Add note that this order does not match the variable parse history order. This is mostly to prevent others from running into this and scratching their heads, trying to find out what is going on. Reviewed-by: Quentin Schulz <foss+yocto@0leil.net> (Bitbake rev: 7379c2855b8497e56481d1ec7b5953e850550b85) Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/doc')
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst26
1 files changed, 26 insertions, 0 deletions
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
index b839e669cf..deb7afad43 100644
--- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
+++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
@@ -319,6 +319,10 @@ The variable ``D`` becomes "dvaladditional data".
319 319
320 You must control all spacing when you use the override syntax. 320 You must control all spacing when you use the override syntax.
321 321
322.. note::
323
324 The overrides are applied in this order, ":append", ":prepend", ":remove".
325
322It is also possible to append and prepend to shell functions and 326It is also possible to append and prepend to shell functions and
323BitBake-style Python functions. See the ":ref:`bitbake-user-manual/bitbake-user-manual-metadata:shell functions`" and ":ref:`bitbake-user-manual/bitbake-user-manual-metadata:bitbake-style python functions`" 327BitBake-style Python functions. See the ":ref:`bitbake-user-manual/bitbake-user-manual-metadata:shell functions`" and ":ref:`bitbake-user-manual/bitbake-user-manual-metadata:bitbake-style python functions`"
324sections for examples. 328sections for examples.
@@ -352,6 +356,28 @@ The variable ``FOO`` becomes
352Like ":append" and ":prepend", ":remove" is applied at variable 356Like ":append" and ":prepend", ":remove" is applied at variable
353expansion time. 357expansion time.
354 358
359.. note::
360
361 The overrides are applied in this order, ":append", ":prepend", ":remove".
362 This implies it is not possible to re-append previously removed strings.
363 However, one can undo a ":remove" by using an intermediate variable whose
364 content is passed to the ":remove" so that modifying the intermediate
365 variable equals to keeping the string in::
366
367 FOOREMOVE = "123 456 789"
368 FOO:remove = "${FOOREMOVE}"
369 ...
370 FOOREMOVE = "123 789"
371
372 This expands to ``FOO:remove = "123 789"``.
373
374.. note::
375
376 Override application order may not match variable parse history, i.e.
377 the output of ``bitbake -e`` may contain ":remove" before ":append",
378 but the result will be removed string, because ":remove" is handled
379 last.
380
355Override Style Operation Advantages 381Override Style Operation Advantages
356----------------------------------- 382-----------------------------------
357 383