From 39c3f42f7708b4ec4e828b1ade00bc45d2bf35a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 12 Apr 2017 14:05:34 +0200 Subject: [PATCH] comps-wrapper: Sort langpacks by name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lubomír Sedlář --- pungi/wrappers/comps.py | 2 +- tests/fixtures/comps-env.xml | 2 +- tests/fixtures/comps-formatted.xml | 2 +- tests/fixtures/comps-group.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pungi/wrappers/comps.py b/pungi/wrappers/comps.py index 506fcfe3..796688d9 100644 --- a/pungi/wrappers/comps.py +++ b/pungi/wrappers/comps.py @@ -261,7 +261,7 @@ class CompsWrapper(object): lang_node = doc.createElement("langpacks") msg_elem.appendChild(lang_node) - for langpack in langpacks: + for langpack in sorted(langpacks, key=lambda x: x['name']): match_node = doc.createElement("match") match_node.setAttribute("name", langpack["name"]) match_node.setAttribute("install", langpack["install"]) diff --git a/tests/fixtures/comps-env.xml b/tests/fixtures/comps-env.xml index d8a0490f..169bd066 100644 --- a/tests/fixtures/comps-env.xml +++ b/tests/fixtures/comps-env.xml @@ -104,6 +104,7 @@ + @@ -120,6 +121,5 @@ - diff --git a/tests/fixtures/comps-formatted.xml b/tests/fixtures/comps-formatted.xml index 510acff6..cbce574d 100644 --- a/tests/fixtures/comps-formatted.xml +++ b/tests/fixtures/comps-formatted.xml @@ -118,6 +118,7 @@ + @@ -134,6 +135,5 @@ - diff --git a/tests/fixtures/comps-group.xml b/tests/fixtures/comps-group.xml index ebf2207d..78b5be26 100644 --- a/tests/fixtures/comps-group.xml +++ b/tests/fixtures/comps-group.xml @@ -84,6 +84,7 @@ + @@ -100,6 +101,5 @@ -