tri des paquets

darcs-hash:20080209184855-af139-b996c2e99bf0d8b7ef2bf179c29441a54bc75aa9.gz
This commit is contained in:
Jeremie Dimino 2008-02-09 19:48:55 +01:00
parent f112789a58
commit 73031a1829

View file

@ -36,15 +36,17 @@ def gen_rules(cache):
group = doc.createElement("Group") group = doc.createElement("Group")
group.setAttribute("name", commands.getoutput("uname -m")) group.setAttribute("name", commands.getoutput("uname -m"))
pkgs = []
for pkg in cache: for pkg in cache:
if pkg.candidateVersion: if pkg.candidateVersion:
pkginfo = doc.createElement("Package") pkgs.append((pkg.name, pkg.candidateVersion))
pkginfo.setAttribute("name", pkg.name) pkgs.sort()
pkginfo.setAttribute("version", pkg.candidateVersion) for (name, version) in pkgs:
group.appendChild(pkginfo) pkginfo = doc.createElement("Package")
pkginfo.setAttribute("name", name)
pkginfo.setAttribute("version", version)
group.appendChild(pkginfo)
root.appendChild(group) root.appendChild(group)
return root return root
if __name__ == "__main__": if __name__ == "__main__":