1 from installclass import BaseInstallClass
3 from rhpl.translate import N_
4 from constants import *
5 from flags import flags
16 log = logging.getLogger("anaconda")
18 # custom installs are easy :-)
19 class InstallClass(BaseInstallClass):
20 # name has underscore used for mnemonics, strip if you dont need it
22 name = N_("PLD Linux")
24 _description = N_("Select this installation type to gain complete "
25 "control over the installation process, including "
26 "software package selection and partitioning.")
27 _descriptionFields = (productName,)
29 allowExtraRepos = True
31 repopaths = { "base": ["PLD/i686/RPMS", "PLD/noarch/RPMS"], }
33 (N_("GNOME Desktop"), [
56 (N_("General Development Tools"), [
59 (N_("Java Development Tools"), [
64 def setInstallData(self, anaconda):
65 BaseInstallClass.setInstallData(self, anaconda)
66 if not anaconda.isKickstart:
67 BaseInstallClass.setDefaultPartitioning(self,
68 anaconda.id.partitions,
71 def setGroupSelection(self, anaconda):
72 grps = anaconda.backend.getDefaultGroups(anaconda)
73 map(lambda x: anaconda.backend.selectGroup(x), grps)
75 def setSteps(self, anaconda):
76 dispatch = anaconda.dispatch
77 BaseInstallClass.setSteps(self, anaconda);
78 dispatch.skipStep("partition")
79 dispatch.skipStep("regkey")
81 # for rhel, we're putting the metadata under productpath
82 def getPackagePaths(self, uri):
84 for (name, path) in self.repopaths.items():
85 if not type(uri) == types.ListType:
87 if not type(path) == types.ListType:
93 lst.append("%s/%s" % (i, p))
97 log.info("package paths is %s" %(rc,))
100 def handleRegKey(self, key, intf, interactive = True):
101 self.repopaths = { "base": "%s" %(productPath,) }
102 self.tasks = self.taskMap[productPath.lower()]
103 self.installkey = key
106 inum = instnum.InstNum(key)
108 if True or not BETANAG: # disable hack keys for non-beta
109 # make sure the log is consistent
110 log.info("repopaths is %s" %(self.repopaths,))
116 # make sure the base products match
117 if inum.get_product_string().lower() != productPath.lower():
118 raise ValueError, "Installation number incompatible with media"
120 for name, path in inum.get_repos_dict().items():
121 # virt is only supported on i386/x86_64. so, let's nuke it
122 # from our repo list on other arches unless you boot with
124 if name.lower() == "virt" and ( \
125 rhpl.getArch() not in ("x86_64","i386")
126 and not flags.debug):
128 self.repopaths[name.lower()] = path
129 log.info("Adding %s repo" % (name,))
133 # simple and stupid for now... if C is in the key, add Clustering
134 # if V is in the key, add Virtualization. etc
135 if key.find("C") != -1:
136 self.repopaths["cluster"] = "Cluster"
137 log.info("Adding Cluster option")
138 if key.find("S") != -1:
139 self.repopaths["clusterstorage"] = "ClusterStorage"
140 log.info("Adding ClusterStorage option")
141 if key.find("W") != -1:
142 self.repopaths["workstation"] = "Workstation"
143 log.info("Adding Workstation option")
144 if key.find("V") != -1:
145 self.repopaths["virt"] = "VT"
146 log.info("Adding Virtualization option")
148 for repo in self.repopaths.values():
149 if not self.taskMap.has_key(repo.lower()):
152 for task in self.taskMap[repo.lower()]:
153 if task not in self.tasks:
154 self.tasks.append(task)
157 log.info("repopaths is %s" %(self.repopaths,))
159 def getBackend(self, methodstr):
160 return yuminstall.YumBackend
162 def __init__(self, expert):
163 BaseInstallClass.__init__(self, expert)
165 self.repopaths = { "base": "%s" %(productPath,) }
167 # minimally set up tasks in case no key is provided
168 self.tasks = self.taskMap[productPath.lower()]