summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro del Castillo <alejandro.delcastillo@ni.com>2016-10-03 16:14:43 -0500
committerAlejandro del Castillo <alejandro.delcastillo@ni.com>2016-10-07 11:29:53 -0500
commit9228b38a81c94bd95ada3a6334404923d67bea66 (patch)
treeefc737daf954556ddb9f52bbc9e0ae247222bdf3
parent9830ab38ea2a7b2854d6c10b30a99d000fe8059a (diff)
downloadopkg-utils-0.3.4.tar.gz
opkg-utils-0.3.4.tar.bz2
opkg-utils-0.3.4.zip
opkg-make-index: print summary on it's own line0.3.4
The Description field on the Packages file doesn't follow the same format used on the Control file. It is incorrectly processing the summary line (it treats it as part of the longer description). Add code to print the summary line on it's own. Fixes issue 9238 Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
-rw-r--r--opkg.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/opkg.py b/opkg.py
index 2acc469..b0d79a6 100644
--- a/opkg.py
+++ b/opkg.py
@@ -478,7 +478,9 @@ class Package(object):
if self.source: out = out + "Source: %s\n" % (self.source)
if self.description:
printable_description = textwrap.dedent(self.description).strip()
- out = out + "Description: %s\n" % textwrap.fill(printable_description, width=74, initial_indent=' ', subsequent_indent=' ')
+ 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.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)