diff options
author | Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> | 2017-05-29 10:36:47 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-05-30 10:14:32 +0100 |
commit | c768c536e4dbee69690d0dc131df05a74b4eac8c (patch) | |
tree | 02b5cd0b6ac2b94fb9b2d9026de09191453fdb6a | |
parent | 4f85500cfc76407fb4950bbb0df216577aea6bd7 (diff) | |
download | openembedded-core-c768c536e4dbee69690d0dc131df05a74b4eac8c.tar.gz openembedded-core-c768c536e4dbee69690d0dc131df05a74b4eac8c.tar.bz2 openembedded-core-c768c536e4dbee69690d0dc131df05a74b4eac8c.zip |
package_ipk: correct ipk multiline descriptions
Empty descriptions lines are set with a space following by a dot and
the multiline ones require a leading space. Also, for non-empty lines,
there is no need for formating with textwrap, so remove the logic for
the latter. The documentation for multiline description was taken from [1].
[1] https://web.archive.org/web/20100727133051/http://handhelds.org:80/moin/moin.cgi/BuildingIpkgs
[YOCTO #10677]
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/package_ipk.bbclass | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass index 5cc7e0a7b2..d2ce3b3e17 100644 --- a/meta/classes/package_ipk.bbclass +++ b/meta/classes/package_ipk.bbclass @@ -148,16 +148,9 @@ def ipk_write_pkg(pkg, d): description = localdata.getVar('DESCRIPTION') or "." description = textwrap.dedent(description).strip() if '\\n' in description: - # Manually indent + # Manually indent: multiline description includes a leading space for t in description.split('\\n'): - # We don't limit the width when manually indent, but we do - # need the textwrap.fill() to set the initial_indent and - # subsequent_indent, so set a large width - line = textwrap.fill(t.strip(), - width=100000, - initial_indent=' ', - subsequent_indent=' ') or '.' - ctrlfile.write('%s\n' % line) + ctrlfile.write(' %s\n' % (t.strip() or ' .')) else: # Auto indent ctrlfile.write('%s\n' % textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' ')) |