Remove null-entry from trailing comma in sorted lists

This commit is contained in:
Stefano Rivera 2010-11-24 19:21:00 +02:00
parent 11d5296e86
commit 952311f101
2 changed files with 5 additions and 1 deletions

3
debian/changelog vendored
View File

@ -6,8 +6,9 @@ ubuntu-dev-tools (0.107) UNRELEASED; urgency=low
- Correct typo in options --wrap-allways -> --wrap-always - Correct typo in options --wrap-allways -> --wrap-always
- Sort debian/install as well as debian/*.install - Sort debian/install as well as debian/*.install
- Add one-space-indentation option: --short-indent - Add one-space-indentation option: --short-indent
- Remove null-entry from trailing comma in sorted lists
-- Stefano Rivera <stefanor@ubuntu.com> Wed, 24 Nov 2010 19:15:28 +0200 -- Stefano Rivera <stefano@rivera.za.net> Wed, 24 Nov 2010 19:19:49 +0200
ubuntu-dev-tools (0.106) experimental; urgency=low ubuntu-dev-tools (0.106) experimental; urgency=low

View File

@ -67,6 +67,9 @@ class Control(object):
packages = map(lambda x: x.strip(), control[entry].split(",")) packages = map(lambda x: x.strip(), control[entry].split(","))
if sort: if sort:
packages = sort_list(packages) packages = sort_list(packages)
# Not explicitly disallowed by Policy but known to break QA tools:
if "" in packages:
packages.remove("")
lenght = len(entry) + 2 * len(packages) + sum(map(len, packages)) lenght = len(entry) + 2 * len(packages) + sum(map(len, packages))
if wrap_always or lenght > 80: if wrap_always or lenght > 80: