debian/lib/python/debian_linux/debian.py: Handle packages with only short descriptions

This commit is contained in:
Ben Hutchings 2016-07-14 11:40:35 +01:00
parent 775cc1229e
commit 619cd907a8
2 changed files with 7 additions and 4 deletions

2
debian/changelog vendored
View File

@ -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.

View File

@ -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()