package_deb.bbclass: Fix multi-line package descriptions
PATCH 1/2 package_deb.bbclass: Fix multi-line package descriptions
In deb control files, each line of a long description starts with a single space. Empty lines are represented by a single space followed by a single full stop character.
Signed-off-by Andreas Oberritter <[email protected]>
---
Please note: As opkg uses the same format, I believe this to be broken in do_package_ipk, too, which generates '.' for empty lines instead of ' .'.
Contrary to the removed comment, the use of textwrap.fill is pointless here.
meta/classes/package_deb.bbclass | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
meta/classes/package_deb.bbclass +1 -4
@@ -176,10 +176,7 @@ python do_package_deb () { if '\\n' in description: # Manually indent 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 - ctrlfile.write('%s\n' % textwrap.fill(t, width=100000, initial_indent=' ', subsequent_indent=' ')) + ctrlfile.write(' %s\n' % (t.strip() or '.')) else: # Auto indent ctrlfile.write('%s\n' % textwrap.fill(description.strip(), width=74, initial_indent=' ', subsequent_indent=' '))
Signature · 1 line
2.7.4
PATCH 2/2 package_deb.bbclass: Avoid writing empty custom fields
Avoids parser errors if PACKAGE_ADD_METADATA_DEB is set to an empty value.
Signed-off-by Andreas Oberritter <[email protected]>
--- meta/classes/package_deb.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/package_deb.bbclass +1 -1
@@ -187,7 +187,7 @@ python do_package_deb () { # more fields custom_fields_chunk = get_package_additional_metadata("deb", localdata) - if custom_fields_chunk is not None: + if custom_fields_chunk: ctrlfile.write(custom_fields_chunk) ctrlfile.write("\n")
Signature · 1 line
2.7.4