diff options
author | Scott Rifenbark <scott.m.rifenbark@intel.com> | 2013-03-01 15:40:05 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-03-02 12:57:22 +0000 |
commit | 2997653fe373f1b9a938367a2e001dfed7f445f0 (patch) | |
tree | cd53d7659ccf4423bdf2be73e122b3cc5e47d4ce | |
parent | d8e26e2b9f8b622d0cef3d3d1392dd0917343ded (diff) | |
download | poky-2997653fe373f1b9a938367a2e001dfed7f445f0.tar.gz |
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 <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | documentation/dev-manual/dev-manual-common-tasks.xml | 36 |
1 files changed, 36 insertions, 0 deletions
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 @@ | |||
726 | types of packages. | 726 | types of packages. |
727 | </para> | 727 | </para> |
728 | 728 | ||
729 | <note> | ||
730 | <para>When writing shell functions, you need to be aware of BitBake's | ||
731 | curly brace parsing. | ||
732 | If a recipe uses a closing curly brace within the function and | ||
733 | the character has no leading spaces, BitBake produces a parsing | ||
734 | error. | ||
735 | If you use a pair of curly brace in a shell function, the | ||
736 | closing curly brace must not be located at the start of the line | ||
737 | without leading spaces.</para> | ||
738 | <para>Here is an example that causes BitBake to produce a parsing | ||
739 | error: | ||
740 | <literallayout class='monospaced'> | ||
741 | fakeroot create_shar() { | ||
742 | cat << "EOF" > ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh | ||
743 | usage() | ||
744 | { | ||
745 | echo "test" | ||
746 | ###### The following "}" at the start of the line causes a parsing error ###### | ||
747 | } | ||
748 | EOF | ||
749 | } | ||
750 | </literallayout> | ||
751 | Writing the recipe this way avoids the error: | ||
752 | <literallayout class='monospaced'> | ||
753 | fakeroot create_shar() { | ||
754 | cat << "EOF" > ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh | ||
755 | usage() | ||
756 | { | ||
757 | echo "test" | ||
758 | ######The following "}" with a leading space at the start of the line avoids the error ###### | ||
759 | } | ||
760 | EOF | ||
761 | } | ||
762 | </literallayout></para> | ||
763 | </note> | ||
764 | |||
729 | <section id='usingpoky-extend-addpkg-singlec'> | 765 | <section id='usingpoky-extend-addpkg-singlec'> |
730 | <title>Single .c File Package (Hello World!)</title> | 766 | <title>Single .c File Package (Hello World!)</title> |
731 | 767 | ||