Skip to contentSkip to conversation

package_deb.bbclass: Fix multi-line package descriptions

PATCH New Andreas Oberritter 1 participant 2 messages Apr 28, 2017

lore
Share & tools
lore
#1 lore raw

PATCH 2/2 package_deb.bbclass: Avoid writing empty custom fields

In reply to Andreas Oberritter

Avoids parser errors if PACKAGE_ADD_METADATA_DEB is set to an empty value.

---
 meta/classes/package_deb.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/package_deb.bbclass +1 -1
index 3cd5efa..eacabcd 100644
@@ -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
#0 lore raw

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.

---
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
index 1f1bc81..3cd5efa 100644
@@ -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