From 2997653fe373f1b9a938367a2e001dfed7f445f0 Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Fri, 1 Mar 2013 15:40:05 -0600 Subject: dev-manual: Added note about BitBake processing brace characters. Fixes YOCTO #3403 Provided a note at the front of the "Adding a Package" section explaining the exception when using a closed curly brace character inside a shell function with the character at the front of a line with no leading spaces. (From yocto-docs rev: a1c0972083751444a8cc89aa8a026f273d98e23e) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- .../dev-manual/dev-manual-common-tasks.xml | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'documentation/dev-manual') diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index 9f8fb333dc..7d8b84986c 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml @@ -726,6 +726,42 @@ types of packages. + + When writing shell functions, you need to be aware of BitBake's + curly brace parsing. + If a recipe uses a closing curly brace within the function and + the character has no leading spaces, BitBake produces a parsing + error. + If you use a pair of curly brace in a shell function, the + closing curly brace must not be located at the start of the line + without leading spaces. + Here is an example that causes BitBake to produce a parsing + error: + + fakeroot create_shar() { + cat << "EOF" > ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh + usage() + { + echo "test" + ###### The following "}" at the start of the line causes a parsing error ###### + } + EOF + } + + Writing the recipe this way avoids the error: + + fakeroot create_shar() { + cat << "EOF" > ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh + usage() + { + echo "test" + ######The following "}" with a leading space at the start of the line avoids the error ###### + } + EOF + } + + +
Single .c File Package (Hello World!) -- cgit v1.2.3-54-g00ecf