[yocto] [opkg-utils PATCH] opkg.py: Remove reformatting of description field

Jeffrey Pautler jeffrey.pautler at ni.com
Thu Oct 5 07:05:59 PDT 2017


The Debian Policy Manual describes the format of the description field.
This includes information about how lines might be wrapped by programs
displaying this information, how to mark lines to not be wrapped, how
to mark a line as blank, and how leading spaces on a multi-line
description might be deleted.

By reformatting the description field in opkg.py, we are breaking many
of these behaviors and taking control of formatting away from the
author of the control file. Instead, we should simply copy the
description field with no reformatting.

Signed-off-by: Jeffrey Pautler <jeffrey.pautler at ni.com>
---
opkg.py | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/opkg.py b/opkg.py
index 9131755..c0cdcd5 100644
--- a/opkg.py
+++ b/opkg.py
@@ -230,7 +230,7 @@ class Package(object):
                 name = lineparts.group(1).lower()
                 value = lineparts.group(2)
                 while 1:
-                    line = control.readline()
+                    line = control.readline().rstrip()
                     if not line: break
                     if line[0] != ' ': break
                     value = value + '\n' + line
@@ -480,11 +480,7 @@ class Package(object):
         if self.installed_size: out = out + "InstalledSize: %d\n" % int(self.installed_size)
         if self.filename: out = out + "Filename: %s\n" % (self.filename)
         if self.source: out = out + "Source: %s\n" % (self.source)
-        if self.description:
-            printable_description = textwrap.dedent(self.description).strip()
-            summary = printable_description.split('\n', 1)[0]
-            printable_description = printable_description.split('\n', 1)[-1].strip()
-            out = out + "Description: %s\n%s\n" % (summary, textwrap.fill(printable_description, width=74, initial_indent=' ', subsequent_indent=' '))
+        if self.description: out = out + "Description: %s\n" % (self.description)
         if self.oe: out = out + "OE: %s\n" % (self.oe)
         if self.homepage: out = out + "HomePage: %s\n" % (self.homepage)
         if self.license: out = out + "License: %s\n" % (self.license)
--
2.7.4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20171005/a1d9500b/attachment.html>


More information about the yocto mailing list