diff options
author | Mike Fulbright <msf@redhat.com> | 2002-07-12 07:02:24 +0000 |
---|---|---|
committer | Mike Fulbright <msf@redhat.com> | 2002-07-12 07:02:24 +0000 |
commit | 87057bacd608c59765056eb797e33eb4bc6cf518 (patch) | |
tree | 93ebfff7ba5771eb4e50059f58850deaaef02ff6 /comps.py | |
parent | 993a04149a7a55c43ab5d3715effb26e84155e7a (diff) | |
download | anaconda-87057bacd608c59765056eb797e33eb4bc6cf518.tar.gz anaconda-87057bacd608c59765056eb797e33eb4bc6cf518.tar.xz anaconda-87057bacd608c59765056eb797e33eb4bc6cf518.zip |
implement comps hierarchy sorting
Diffstat (limited to 'comps.py')
-rw-r--r-- | comps.py | 125 |
1 files changed, 62 insertions, 63 deletions
@@ -811,69 +811,68 @@ class ComponentSet: # this is a temporary way to set order of packages def orderPackageGroups(curgroups): - compsOrder = [ - "Base X Support", - "Printing Support", - "GNOME Desktop Environment", - "KDE Desktop Environment", - "Messaging and Web Tools", - "GNOME Messaging and Web Tools", - "KDE Messaging and Web Tools", - "Multimedia Software", - "GNOME Multimedia Software", - "KDE Multimedia Software", - "Office/Productivity Software", - "GNOME Office/Productivity Software", - "KDE Office/Productivity Software", - "Authoring and Publishing", - "Games and Entertainment", - "GNOME Games and Entertainment", - "KDE Games and Entertainment", - "X Based Games and Entertainment", - "Emacs", - "Kernel Development", - "Software Development", - "GNOME Software Development", - "KDE Software Development", - "X Software Development", - "Multimedia Software Development", - "Utilities", - "Workstation Tools", - "Dialup Networking Support", - "NFS File Server", - "Web Server", - "FTP Server", - "Windows File Server", - "DNS Name Server", - "SQL Database Server", - "Network Servers", - "News Server", - ] + compsParents = ["Desktops", "Applications", "Servers", "Development", "System"] + compsHierarchy = { "Desktops" : ["GNOME Desktop Environment", + "KDE Desktop Environment"], + "Applications" : ["Internet Applications", + "Office/Productivity Applications", + "Sound and Video Applications", + "Graphics Applications", + "Games and Entertainment", + "Authoring and Publishing", + "Text Based Applications"], + "Servers" : [ "Server Configuration Tools", + "Web Server", + "Windows File Server", + "NFS File Server", + "DNS Name Server", + "FTP Server", + "SQL Database Server", + "News Server", + "Network Servers"], + "Development" : [ "Emacs", + "Development Tools", + "Development Libraries", + "Kernel Development", + "X Software Development", + "GNOME Software Development", + "KDE Software Development"], + "System" : [ "System Tools", + "Printing Support", + "X Window System"] } + + curgrpnames = [] + for grp in curgroups: + curgrpnames.append(grp.name) ignorelst = [] - retval = [] - while 1: - bestfit = len(compsOrder)+1 - bestgrp = None - for grp in curgroups: - if grp.name in ignorelst: - continue - if grp.name in compsOrder: - if compsOrder.index(grp.name) < bestfit: - bestfit = compsOrder.index(grp.name) - bestgrp = grp - - if bestgrp is None: - for grp in curgroups: - if grp.name not in ignorelst: - bestgrp = grp - break - - if bestgrp is None: - break - - ignorelst.append(bestgrp.name) - retval.append(bestgrp) - - return retval + retlist = [] + retdict = {} + + for key in compsParents: + compslist = compsHierarchy[key] + for grp in compslist: + + if grp in curgrpnames: + thecomp = curgroups[curgrpnames.index(grp)] + ignorelst.append(grp) + if key not in retlist: + retlist.append(key) + retdict[key] = [thecomp] + else: + retdict[key].append(thecomp) + + miscgrp = "Miscellaneous" + for grp in curgrpnames: + if grp in ignorelst: + continue + + thecomp = curgroups[curgrpnames.index(grp)] + if miscgrp not in retlist: + retlist.append(miscgrp) + retdict[miscgrp] = [thecomp] + else: + retdict[miscgrp].append(thecomp) + + return (retlist, retdict) |