Bug 10444

Summary: Suggested documentation to explain line joining
Product: [Documentation] BitBake User Manual Reporter: ulfalizer
Component: bitbake-manualAssignee: Scott Rifenbark <srifenbark>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Undecided CC: srifenbark
Version: 2.2   
Target Milestone: 2.3 M1   
Hardware: x86   
OS: Multiple   
Whiteboard: 19 Oct 2016: RESOLVED
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Done (doc changes complete)

Description ulfalizer 2016-10-17 13:07:20 UTC
Hello Scott,

It's not documented how line joining works. This is mostly stuff that people
figure out quickly anyway, but it doesn't hurt to cover it in some detail.

Here's a suggested new section:

  3.1.2. Line joining
  
  Outside of
  [functions](https://www.yoctoproject.org/docs/2.2/bitbake-user-manual/bitbake-user-manual.html#functions)
  , BitBake joins any line ending in "\" with the following line before parsing
  statements. This is most commonly used to split variable assignments over
  multiple lines, as in the following example:
  
    FOO = "bar \
           baz \
           qaz"
  
  Both the backslash and the newline that follows it are removed when joining
  lines, so no newlines end up in the value of FOO. As another example, the two
  assignments below both assign "barbaz" to FOO:
  
    FOO = "barbaz"
  
    FOO = "bar\
    baz"
  
  Note {
  BitBake does not interpet 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, like 'printf' or 'echo -n'.
  }


Cheers,
Ulf
Comment 1 ulfalizer 2016-10-17 13:08:35 UTC
Typo: "interpet" should be "interpret"
Comment 2 Scott Rifenbark 2016-10-19 16:11:40 UTC
Ulf, 

Here is the new section - http://www.yoctoproject.org/docs/2.2/bitbake-user-manual/bitbake-user-manual.html#line-joining.  I did a bit of word smithing. 

Thanks, 
Scott
Comment 3 ulfalizer 2016-10-19 18:20:10 UTC
Thanks!

I'd write "newline" rather than "new line" to make it clear that it's talking about a character rather than about an entire line. That seems to be the convention from looking at https://en.wikipedia.org/wiki/Newline as well. The rest looks fine.

Cheers,
Ulf
Comment 4 Scott Rifenbark 2016-10-19 18:44:32 UTC
Hi Ulf, 

Okay - good point.  I changed it.  See http://www.yoctoproject.org/docs/2.2/bitbake-user-manual/bitbake-user-manual.html#line-joining. 

I am going to set as RESOLVED and put the doc flag at "done."

Thanks, 
Scott