From 73031a1829cdc8b8b3d494325af96530f0838e56 Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Sat, 9 Feb 2008 19:48:55 +0100 Subject: [PATCH] tri des paquets darcs-hash:20080209184855-af139-b996c2e99bf0d8b7ef2bf179c29441a54bc75aa9.gz --- bcfg2/create-versions-index.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bcfg2/create-versions-index.py b/bcfg2/create-versions-index.py index 9554e150..bee30f58 100755 --- a/bcfg2/create-versions-index.py +++ b/bcfg2/create-versions-index.py @@ -36,15 +36,17 @@ def gen_rules(cache): group = doc.createElement("Group") group.setAttribute("name", commands.getoutput("uname -m")) + pkgs = [] for pkg in cache: if pkg.candidateVersion: - pkginfo = doc.createElement("Package") - pkginfo.setAttribute("name", pkg.name) - pkginfo.setAttribute("version", pkg.candidateVersion) - group.appendChild(pkginfo) - + pkgs.append((pkg.name, pkg.candidateVersion)) + pkgs.sort() + for (name, version) in pkgs: + pkginfo = doc.createElement("Package") + pkginfo.setAttribute("name", name) + pkginfo.setAttribute("version", version) + group.appendChild(pkginfo) root.appendChild(group) - return root if __name__ == "__main__":