diff options
| author | Robert Yang <liezhi.yang@windriver.com> | 2013-06-19 01:25:38 -0400 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-07-10 09:42:03 +0100 |
| commit | 33cd81e18b797d4257e02622ac5ca3eaf886c6e2 (patch) | |
| tree | 7936579d4855e2f63eaebe7cad5ec3f04c63e497 | |
| parent | 477b2c9860c6076197cccf02650d6e0fee829290 (diff) | |
| download | poky-33cd81e18b797d4257e02622ac5ca3eaf886c6e2.tar.gz | |
package_ipk.bbclass: make DESCRIPTION support newline
The recipe's DESCRIPTION is wrapped automatically by textwrap, make it
support newline ("\n") to let the user can wrap it manually, e.g.:
DESCRIPTION = "Foo1\nFoo2"
In the past, it would be:
Foo1\nFoo2
Now:
Foo1
Foo2
[YOCTO #4348]
(From OE-Core rev: dff04de2de8bb159fd6912e29794eadd75d5d92a)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/classes/package_ipk.bbclass | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass index 55628e4a51..33058797e3 100644 --- a/meta/classes/package_ipk.bbclass +++ b/meta/classes/package_ipk.bbclass | |||
| @@ -304,10 +304,19 @@ python do_package_ipk () { | |||
| 304 | # Special behavior for description... | 304 | # Special behavior for description... |
| 305 | if 'DESCRIPTION' in fs: | 305 | if 'DESCRIPTION' in fs: |
| 306 | summary = localdata.getVar('SUMMARY', True) or localdata.getVar('DESCRIPTION', True) or "." | 306 | summary = localdata.getVar('SUMMARY', True) or localdata.getVar('DESCRIPTION', True) or "." |
| 307 | ctrlfile.write('Description: %s\n' % summary) | ||
| 307 | description = localdata.getVar('DESCRIPTION', True) or "." | 308 | description = localdata.getVar('DESCRIPTION', True) or "." |
| 308 | description = textwrap.dedent(description).strip() | 309 | description = textwrap.dedent(description).strip() |
| 309 | ctrlfile.write('Description: %s\n' % summary) | 310 | if '\\n' in description: |
| 310 | ctrlfile.write('%s\n' % textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' ')) | 311 | # Manually indent |
| 312 | for t in description.split('\\n'): | ||
| 313 | # We don't limit the width when manually indent, but we do | ||
| 314 | # need the textwrap.fill() to set the initial_indent and | ||
| 315 | # subsequent_indent, so set a large width | ||
| 316 | ctrlfile.write('%s\n' % textwrap.fill(t.strip(), width=100000, initial_indent=' ', subsequent_indent=' ')) | ||
| 317 | else: | ||
| 318 | # Auto indent | ||
| 319 | ctrlfile.write('%s\n' % textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' ')) | ||
| 311 | else: | 320 | else: |
| 312 | ctrlfile.write(c % tuple(pullData(fs, localdata))) | 321 | ctrlfile.write(c % tuple(pullData(fs, localdata))) |
| 313 | except KeyError: | 322 | except KeyError: |
