[linux] 02/03: debian/lib/python/debian_linux/debian.py: Handle packages with only short descriptions

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Thu Jul 14 12:03:47 UTC 2016


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch master
in repository linux.

commit 619cd907a82b999d0de75d200ac97eb953983aa6
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Thu Jul 14 11:40:35 2016 +0100

    debian/lib/python/debian_linux/debian.py: Handle packages with only short descriptions
---
 debian/changelog                         | 2 ++
 debian/lib/python/debian_linux/debian.py | 9 +++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 55ee736..d6136e3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,6 +17,8 @@ linux (4.7~rc7-1~exp1) UNRELEASED; urgency=medium
     - Warn and taint kernel if this feature is actually used
   * Define Auto-Built-Package field when running dpkg-gencontrol, as dpkg-source
     doesn't like to see it in debian/control
+  * debian/lib/python/debian_linux/debian.py: Handle packages with only short
+    descriptions
 
   [ Bastian Blank ]
   * Mark debug symbols packages to move them into the debug archive.
diff --git a/debian/lib/python/debian_linux/debian.py b/debian/lib/python/debian_linux/debian.py
index 38682a9..92576d1 100644
--- a/debian/lib/python/debian_linux/debian.py
+++ b/debian/lib/python/debian_linux/debian.py
@@ -216,9 +216,10 @@ class PackageDescription(object):
         self.short = []
         self.long = []
         if value is not None:
-            short, long = value.split(u"\n", 1)
-            self.append(long)
-            self.append_short(short)
+            desc_split = value.split("\n", 1)
+            self.append_short(desc_split[0])
+            if len(desc_split) == 2:
+                self.append(desc_split[1])
 
     def __str__(self):
         wrap = utils.TextWrapper(width=74, fix_sentence_endings=True).wrap
@@ -227,7 +228,7 @@ class PackageDescription(object):
         for i in self.long:
             long_pars.append(wrap(i))
         long = '\n .\n '.join(['\n '.join(i) for i in long_pars])
-        return short + '\n ' + long
+        return short + '\n ' + long if long else short
 
     def append(self, str):
         str = str.strip()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list