From a27c19cb5cac10d8cde233dd1a0b5798e4c4f58b Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Fri, 26 Nov 2010 18:03:28 +0200 Subject: [PATCH] Sort Architecture (LP: #681131) --- debian/changelog | 3 ++- wrap-and-sort | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 2098eae..c9f358b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,7 @@ ubuntu-dev-tools (0.107) UNRELEASED; urgency=low - Add one-space-indentation option: --short-indent - Remove null-entry from trailing comma in sorted lists - Add configurable debian directory location + - Sort Architecture (LP: #681131) * dgetlp, grab-merge, pull-lp-source, syncpackage: Export DEB_VENDOR=Ubuntu when unpacking source packages. 3.0 (quilt) has optional per-vendor patch series. @@ -17,7 +18,7 @@ ubuntu-dev-tools (0.107) UNRELEASED; urgency=low * wrap-and-sort: Remove duplicate items from sorted lists. * syncpackage: Fix error message for failed downloads. - -- Benjamin Drung Thu, 25 Nov 2010 23:48:55 +0100 + -- Stefano Rivera Fri, 26 Nov 2010 18:01:54 +0200 ubuntu-dev-tools (0.106) experimental; urgency=low diff --git a/wrap-and-sort b/wrap-and-sort index c92f386..572b214 100755 --- a/wrap-and-sort +++ b/wrap-and-sort @@ -63,6 +63,10 @@ class Control(object): if "Uploaders" in paragraph: self._wrap_field(paragraph, "Uploaders", wrap_always, short_indent, False) + if "Architecture" in paragraph: + archs = set(paragraph["Architecture"].split()) + paragraph["Architecture"] = " ".join( + sorted(archs, key=lambda x: (1 - int("any" in x), x))) def _wrap_field(self, control, entry, wrap_always, short_indent, sort=True): packages = map(lambda x: x.strip(), control[entry].split(","))