From 2fc72083332ba66b2b95c475ee7b6f8252f5c32f Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Fri, 26 Nov 2010 18:19:59 +0200 Subject: [PATCH] Add explanatory comment to architecture-sorting, break up scary-long-line --- wrap-and-sort | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wrap-and-sort b/wrap-and-sort index 572b214..f98efc0 100755 --- a/wrap-and-sort +++ b/wrap-and-sort @@ -65,8 +65,9 @@ class Control(object): 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))) + # Sort, with wildcard entries (such as linux-any) first: + archs = sorted(archs, key=lambda x: (1 - int("any" in x), x)) + paragraph["Architecture"] = " ".join(archs) def _wrap_field(self, control, entry, wrap_always, short_indent, sort=True): packages = map(lambda x: x.strip(), control[entry].split(","))