Bug 10444 - Suggested documentation to explain line joining
Summary: Suggested documentation to explain line joining
Status: RESOLVED FIXED
Alias: None
Product: BitBake User Manual
Classification: Documentation
Component: bitbake-manual (show other bugs)
Version: 2.2
Hardware: x86 Multiple
: Undecided normal
Target Milestone: 2.3 M1
Assignee: Scott Rifenbark
QA Contact:
URL:
Whiteboard: 19 Oct 2016: RESOLVED
Depends on:
Blocks:
 
Reported: 2016-10-17 13:07 UTC by ulfalizer
Modified: 2016-10-19 18:44 UTC (History)
1 user (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Done (doc changes complete)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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