From 95a5fadc15e1cf297023a0592b65791d59d29807 Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Mon, 2 Jun 2014 17:54:51 +0300 Subject: [PATCH] dev-manual: Edits to the "Understanding Recipe Syntax" section. Added a new "Overrides" bullet item and fixed some minor issues pointed out by Paul Eggleton. (From yocto-docs rev: 44ff3d82985fa304c5641570fe72cf6a8ddabaa3) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- .../dev-manual/dev-manual-common-tasks.xml | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index 6ae7730f81..8b2613aa12 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml @@ -1498,7 +1498,7 @@ or tabs after the slash character. - Using Variables: {...} - + Using Variables: ${...} - Use the ${<varname>} syntax to access the contents of a variable: @@ -1615,6 +1615,30 @@ CFLAGS_prepend_sh4 = " file://fix-makefile.patch" + Overrides: - + You can use overrides to set a value conditionally, + typically on how the recipe is being built. + For example, to set the + KBRANCH + variable's value to "standard/base" for any target + MACHINE, + except for qemuarm where it should be set to + "standard/arm-versatile-926ejs", you would do the + following: + + KBRANCH = "standard/base" + KBRANCH_qemuarm = "standard/arm-versatile-926ejs" + + Overrides are also used to separate alternate values + of a variable in other situations. + For example, when setting variables such as + FILES + and + RDEPENDS, + that are specific to individual packages produced by + a recipe, you should always use an override that + specifies the name of the package. + Indentation: Use spaces for indentation rather than than tabs. For shell functions, both currently work. @@ -1623,13 +1647,13 @@ Realize that some layers have a policy to use spaces for all indentation. - Using Python for Complex Operations: ${@<variable>} - + Using Python for Complex Operations: ${@<python_code>} - For more advanced processing, it is possible to use Python code during variable assignments (e.g. search and replacement on a variable). You indicate Python code using the - ${@<variable>} syntax for the - variable assignment: + ${@<python_code>} + syntax for the variable assignment: SRC_URI = "ftp://ftp.info-zip.org/pub/infozip/src/zip${@d.getVar('PV',1).replace('.', '')}.tgz