diff options
author | Marek Vasut <marex@denx.de> | 2022-12-18 01:10:30 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-21 14:15:26 +0000 |
commit | 7ee2ee05723b1babbec326d7b381531c81f3c1fd (patch) | |
tree | a6db85f07e2700b70e7eb26159340c2587049704 /bitbake/doc | |
parent | 1628054eca82f3441cc119a8f741d00360171e77 (diff) | |
download | poky-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.rst | 26 |
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 | |||
322 | It is also possible to append and prepend to shell functions and | 326 | It is also possible to append and prepend to shell functions and |
323 | BitBake-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`" | 327 | BitBake-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`" |
324 | sections for examples. | 328 | sections for examples. |
@@ -352,6 +356,28 @@ The variable ``FOO`` becomes | |||
352 | Like ":append" and ":prepend", ":remove" is applied at variable | 356 | Like ":append" and ":prepend", ":remove" is applied at variable |
353 | expansion time. | 357 | expansion 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 | |||
355 | Override Style Operation Advantages | 381 | Override Style Operation Advantages |
356 | ----------------------------------- | 382 | ----------------------------------- |
357 | 383 | ||