1 from installclass import BaseInstallClass
2 from constants import *
4 from flags import flags
15 _ = lambda x: gettext.ldgettext("anaconda", x)
18 log = logging.getLogger("anaconda")
20 # custom installs are easy :-)
21 class InstallClass(BaseInstallClass):
22 # name has underscore used for mnemonics, strip if you dont need it
24 name = N_("PLD Linux")
26 _description = N_("The default installation of %s includes a set of "
27 "software applicable for general internet usage. "
28 "What additional tasks would you like your system "
29 "to include support for?")
30 _descriptionFields = (productName,)
32 allowExtraRepos = True
34 repopaths = { "base": ["PLD/i686/RPMS", "PLD/noarch/RPMS"], }
35 taskMap = {'client': [
36 (N_("GNOME Desktop"), [
59 (N_("General Development Tools"), [
62 (N_("Java Development Tools"), [
67 def setInstallData(self, anaconda):
68 BaseInstallClass.setInstallData(self, anaconda)
69 if not anaconda.isKickstart:
70 BaseInstallClass.setDefaultPartitioning(self,
71 anaconda.id.partitions,
74 def setGroupSelection(self, anaconda):
75 grps = anaconda.backend.getDefaultGroups(anaconda)
76 map(lambda x: anaconda.backend.selectGroup(x), grps)
78 def setSteps(self, anaconda):
79 dispatch = anaconda.dispatch
80 BaseInstallClass.setSteps(self, anaconda);
81 dispatch.skipStep("partition")
82 dispatch.skipStep("regkey")
84 # for rhel, we're putting the metadata under productpath
85 def getPackagePaths(self, uri):
87 for (name, path) in self.repopaths.items():
88 if not type(uri) == types.ListType:
90 if not type(path) == types.ListType:
96 lst.append("%s/%s" % (i, p))
100 log.info("package paths is %s" %(rc,))
103 def handleRegKey(self, key, intf, interactive = True):
104 self.repopaths = { "base": "%s" %(productPath,) }
105 self.tasks = self.taskMap[productPath.lower()]
106 self.installkey = key
109 inum = instnum.InstNum(key)
111 if True or not BETANAG: # disable hack keys for non-beta
112 # make sure the log is consistent
113 log.info("repopaths is %s" %(self.repopaths,))
119 # make sure the base products match
120 if inum.get_product_string().lower() != productPath.lower():
121 raise ValueError, "Installation number incompatible with media"
123 for name, path in inum.get_repos_dict().items():
124 # virt is only supported on i386/x86_64. so, let's nuke it
125 # from our repo list on other arches unless you boot with
127 if name.lower() == "virt" and ( \
128 rhpl.getArch() not in ("x86_64","i386")
129 and not flags.debug):
131 self.repopaths[name.lower()] = path
132 log.info("Adding %s repo" % (name,))
136 # simple and stupid for now... if C is in the key, add Clustering
137 # if V is in the key, add Virtualization. etc
138 if key.find("C") != -1:
139 self.repopaths["cluster"] = "Cluster"
140 log.info("Adding Cluster option")
141 if key.find("S") != -1:
142 self.repopaths["clusterstorage"] = "ClusterStorage"
143 log.info("Adding ClusterStorage option")
144 if key.find("W") != -1:
145 self.repopaths["workstation"] = "Workstation"
146 log.info("Adding Workstation option")
147 if key.find("V") != -1:
148 self.repopaths["virt"] = "VT"
149 log.info("Adding Virtualization option")
151 for repo in self.repopaths.values():
152 if not self.taskMap.has_key(repo.lower()):
155 for task in self.taskMap[repo.lower()]:
156 if task not in self.tasks:
157 self.tasks.append(task)
160 log.info("repopaths is %s" %(self.repopaths,))
162 def getBackend(self):
163 return yuminstall.YumBackend
165 def __init__(self, expert):
166 BaseInstallClass.__init__(self, expert)
168 self.repopaths = { "base": "%s" %(productPath,) }
170 # minimally set up tasks in case no key is provided
171 self.tasks = self.taskMap[productPath.lower()]