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:15:19 +0100 |
commit | 41dcb7d3bd666798e3a862d3a09e716eb0492f26 (patch) | |
tree | e65e814c40729956134f0c5a23b4d8d78c9ff568 | |
parent | 0c40be9088f2fa2f02d6916a140967c80943fffd (diff) | |
download | poky-41dcb7d3bd666798e3a862d3a09e716eb0492f26.tar.gz |
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]
(From OE-Core rev: c768c536e4dbee69690d0dc131df05a74b4eac8c)
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): | |||
148 | description = localdata.getVar('DESCRIPTION') or "." | 148 | description = localdata.getVar('DESCRIPTION') or "." |
149 | description = textwrap.dedent(description).strip() | 149 | description = textwrap.dedent(description).strip() |
150 | if '\\n' in description: | 150 | if '\\n' in description: |
151 | # Manually indent | 151 | # Manually indent: multiline description includes a leading space |
152 | for t in description.split('\\n'): | 152 | for t in description.split('\\n'): |
153 | # We don't limit the width when manually indent, but we do | 153 | ctrlfile.write(' %s\n' % (t.strip() or ' .')) |
154 | # need the textwrap.fill() to set the initial_indent and | ||
155 | # subsequent_indent, so set a large width | ||
156 | line = textwrap.fill(t.strip(), | ||
157 | width=100000, | ||
158 | initial_indent=' ', | ||
159 | subsequent_indent=' ') or '.' | ||
160 | ctrlfile.write('%s\n' % line) | ||
161 | else: | 154 | else: |
162 | # Auto indent | 155 | # Auto indent |
163 | ctrlfile.write('%s\n' % textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' ')) | 156 | ctrlfile.write('%s\n' % textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' ')) |