]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake-user-manual: Added new "Line Joining" section.
authorScott Rifenbark <srifenbark@gmail.com>
Wed, 19 Oct 2016 16:10:17 +0000 (09:10 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 8 Dec 2016 16:35:56 +0000 (16:35 +0000)
Fixes [YOCTO #10444]

Added a new section about syntax called "Line Joining".  The
section describes how you can use the backslash character (\)
to joing stuff.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
doc/bitbake-user-manual/bitbake-user-manual-metadata.xml

index 6103f34f0bf2180b8f9f0eac6a9f5c51fd40995e..badc7c0e46f5239d9eadb75fb1e1c5a6c9ad6794 100644 (file)
             </para>
         </section>
 
+        <section id='line-joining'>
+            <title>Line Joining</title>
+
+            <para>
+                Outside of
+                <link linkend='functions'>functions</link>, BitBake joins
+                any line ending in a backslash character ("\")
+                with the following line before parsing statements.
+                The most common use for the "\" character is to split variable
+                assignments over multiple lines, as in the following example:
+                <literallayout class='monospaced'>
+     FOO = "bar \
+            baz \
+            qaz"
+                </literallayout>
+                Both the "\" character and the newline character
+                that follow it are removed when joining lines.
+                Thus, no newline characters end up in the value of
+                <filename>FOO</filename>.
+            </para>
+
+            <para>
+                Consider this additional example where the two
+                assignments both assign "barbaz" to
+                <filename>FOO</filename>:
+                <literallayout class='monospaced'>
+     FOO = "barbaz"
+
+     FOO = "bar\
+     baz"
+                </literallayout>
+                <note>
+                    BitBake does not interpret escape sequences like
+                    "\n" in variable values.
+                    For these to have an effect, the value must be passed
+                    to some utility that interprets escape sequences,
+                    such as <filename>printf</filename> or
+                    <filename>echo -n</filename>.
+                </note>
+            </para>
+        </section>
+
         <section id='variable-expansion'>
             <title>Variable Expansion</title>