From ba64f36109ec19ca4d4af64154c69ae763e408b2 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Wed, 24 Nov 2010 21:02:11 +0100 Subject: [PATCH] wrap-and-sort: Remove duplicate items from sorted lists. --- debian/changelog | 6 +++++- wrap-and-sort | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2f0c295..681e61f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ ubuntu-dev-tools (0.107) UNRELEASED; urgency=low + [ Stefano Rivera ] * edit-patch: Detect quilt patch-system in 3.0 (quilt) packages without any patches yet. * wrap-and-sort: @@ -11,7 +12,10 @@ ubuntu-dev-tools (0.107) UNRELEASED; urgency=low when unpacking source packages. 3.0 (quilt) has optional per-vendor patch series. - -- Stefano Rivera Wed, 24 Nov 2010 21:31:51 +0200 + [ Benjamin Drung ] + * wrap-and-sort: Remove duplicate items from sorted lists. + + -- Benjamin Drung Wed, 24 Nov 2010 21:00:40 +0100 ubuntu-dev-tools (0.106) experimental; urgency=low diff --git a/wrap-and-sort b/wrap-and-sort index e32d1f7..d44ce11 100755 --- a/wrap-and-sort +++ b/wrap-and-sort @@ -66,10 +66,12 @@ class Control(object): def _wrap_field(self, control, entry, wrap_always, short_indent, sort=True): packages = map(lambda x: x.strip(), control[entry].split(",")) if sort: - packages = sort_list(packages) + # Remove duplicate entries + packages = set(packages) # Not explicitly disallowed by Policy but known to break QA tools: if "" in packages: packages.remove("") + packages = sort_list(packages) length = len(entry) + 2 * len(packages) + sum(map(len, packages)) if wrap_always or length > 80: