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 | 258b8a2cb4178990fc20102add1e3043ac80dbf9 (patch) | |
tree | 5a121cdd57fc3ae4435327a39cc98ea92dcd6237 /meta | |
parent | 33cd81e18b797d4257e02622ac5ca3eaf886c6e2 (diff) | |
download | poky-258b8a2cb4178990fc20102add1e3043ac80dbf9.tar.gz |
package_deb.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: 568e303ef4447a9ddb7fb6370166d012a4375dab)
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>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/package_deb.bbclass | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass index 949432e32d..663f6461c8 100644 --- a/meta/classes/package_deb.bbclass +++ b/meta/classes/package_deb.bbclass | |||
@@ -279,10 +279,20 @@ python do_package_deb () { | |||
279 | # Special behavior for description... | 279 | # Special behavior for description... |
280 | if 'DESCRIPTION' in fs: | 280 | if 'DESCRIPTION' in fs: |
281 | summary = localdata.getVar('SUMMARY', True) or localdata.getVar('DESCRIPTION', True) or "." | 281 | summary = localdata.getVar('SUMMARY', True) or localdata.getVar('DESCRIPTION', True) or "." |
282 | ctrlfile.write('Description: %s\n' % unicode(summary)) | ||
282 | description = localdata.getVar('DESCRIPTION', True) or "." | 283 | description = localdata.getVar('DESCRIPTION', True) or "." |
283 | description = textwrap.dedent(description).strip() | 284 | description = textwrap.dedent(description).strip() |
284 | ctrlfile.write('Description: %s\n' % unicode(summary)) | 285 | if '\\n' in description: |
285 | ctrlfile.write('%s\n' % unicode(textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' '))) | 286 | # Manually indent |
287 | for t in description.split('\\n'): | ||
288 | # We don't limit the width when manually indent, but we do | ||
289 | # need the textwrap.fill() to set the initial_indent and | ||
290 | # subsequent_indent, so set a large width | ||
291 | ctrlfile.write('%s\n' % unicode(textwrap.fill(t, width=100000, initial_indent=' ', subsequent_indent=' '))) | ||
292 | else: | ||
293 | # Auto indent | ||
294 | ctrlfile.write('%s\n' % unicode(textwrap.fill(description.strip(), width=74, initial_indent=' ', subsequent_indent=' '))) | ||
295 | |||
286 | else: | 296 | else: |
287 | ctrlfile.write(unicode(c % tuple(pullData(fs, localdata)))) | 297 | ctrlfile.write(unicode(c % tuple(pullData(fs, localdata)))) |
288 | except KeyError: | 298 | except KeyError: |