diff options
-rw-r--r-- | dispatch.py | 2 | ||||
-rwxr-xr-x | gui.py | 60 | ||||
-rw-r--r-- | installclass.py | 12 | ||||
-rw-r--r-- | installclasses/fedora.py | 2 | ||||
-rw-r--r-- | installclasses/rhel_as.py | 42 | ||||
-rw-r--r-- | installclasses/rhel_desktop.py | 43 | ||||
-rw-r--r-- | installclasses/rhel_es.py | 42 | ||||
-rw-r--r-- | installclasses/rhel_ws.py | 47 | ||||
-rw-r--r-- | packages.py | 19 | ||||
-rw-r--r-- | text.py | 9 | ||||
-rw-r--r-- | yuminstall.py | 13 |
11 files changed, 103 insertions, 188 deletions
diff --git a/dispatch.py b/dispatch.py index a41ca1a54..9979c67e6 100644 --- a/dispatch.py +++ b/dispatch.py @@ -26,6 +26,7 @@ from packages import firstbootConfiguration from packages import betaNagScreen from packages import setupTimezone from packages import setFileCons +from packages import regKeyScreen from partitioning import partitionObjectsInitialize from partitioning import partitioningComplete from bootloader import writeBootloader, bootloaderSetupChoices @@ -62,6 +63,7 @@ installSteps = [ ("betanag", betaNagScreen, ), ("language", ), ("keyboard", ), + ("regkey", regKeyScreen, ), ("findrootparts", findRootParts, ), ("findinstall", ), ("zfcpconfig", ), @@ -660,11 +660,13 @@ class MessageWindow: def getrc (self): return self.rc - def __init__ (self, title, text, type="ok", default=None, custom_buttons=None, custom_icon=None): + def __init__ (self, title, text, type="ok", default=None, custom_buttons=None, custom_icon=None, run = True, destroyAfterRun = True): + self.title = title if flags.autostep: self.rc = 1 return self.rc = None + self.framed = False docustom = 0 if type == 'ok': buttons = gtk.BUTTONS_OK @@ -692,7 +694,7 @@ class MessageWindow: elif custom_icon == "info": style = gtk.MESSAGE_INFO - dialog = gtk.MessageDialog(mainWindow, 0, style, buttons, text) + self.dialog = gtk.MessageDialog(mainWindow, 0, style, buttons, text) if docustom: rid=0 @@ -702,7 +704,7 @@ class MessageWindow: else: tbutton = button - widget = dialog.add_button(tbutton, rid) + widget = self.dialog.add_button(tbutton, rid) rid = rid + 1 defaultchoice = rid - 1 @@ -714,15 +716,21 @@ class MessageWindow: else: defaultchoice = 0 - addFrame(dialog, title=title) - dialog.set_position (gtk.WIN_POS_CENTER) - dialog.set_default_response(defaultchoice) - dialog.show_all () + self.dialog.set_position (gtk.WIN_POS_CENTER) + self.dialog.set_default_response(defaultchoice) + if run: + self.run(destroyAfterRun) + + def run(self, destroy = False): + if not self.framed: + addFrame(self.dialog, title=self.title) + self.framed = True + self.dialog.show_all () # XXX - Messy - turn off busy cursor if necessary busycursor = getBusyCursorStatus() setCursorToNormal() - rc = dialog.run() + rc = self.dialog.run() if rc == gtk.RESPONSE_OK or rc == gtk.RESPONSE_YES: self.rc = 1 @@ -733,11 +741,39 @@ class MessageWindow: self.rc = 0 else: self.rc = rc - dialog.destroy() + if destroy: + self.dialog.destroy() # restore busy cursor if busycursor: setCursorToBusy() + +class EntryWindow(MessageWindow): + def __init__ (self, title, text, prompt, entrylength = None): + mainWindow = None + MessageWindow.__init__(self, title, text, type = "okcancel", custom_icon="question", run = False) + self.entry = gtk.Entry() + if entrylength: + self.entry.set_width_chars(entrylength) + self.entry.set_max_length(entrylength) + + # eww, eww, eww... but if we pack in the vbox, it goes to the right + # place! + self.dialog.child.pack_start(self.entry) + + def run(self): + MessageWindow.run(self) + if self.rc == 0: + return None + t = self.entry.get_text() + t.strip() + if len(t) == 0: + return None + return t + + def destroy(self): + self.dialog.destroy() + class InstallInterface: def __init__ (self): @@ -775,6 +811,12 @@ class InstallInterface: custom_buttons, custom_icon).getrc() return rc + def entryWindow(self, title, text, type="ok", entrylength = None): + d = EntryWindow(title, text, type, entrylength) + rc = d.run() + d.destroy() + return rc + def exceptionWindow(self, shortText, longTextFile): log.critical(shortText) win = ExceptionWindow (shortText, longTextFile) diff --git a/installclass.py b/installclass.py index 827432eb2..a6ffde8d1 100644 --- a/installclass.py +++ b/installclass.py @@ -52,6 +52,9 @@ class BaseInstallClass: # don't force text mode forceTextMode = 0 + # allow additional software repositories beyond the base to be configured + allowExtraRepos = True + # by default, place this under the "install" category; it gets it's # own toplevel category otherwise parentClass = ( _("Install on System"), "install.png" ) @@ -181,6 +184,15 @@ class BaseInstallClass: dispatch.skipStep("keyboard", permanent = 1) dispatch.skipStep("writexconfig", permanent = 1) + # modifies the uri from installmethod.getMethodUri() to take into + # account any installclass specific things including multiple base + # repositories. takes a string, returns a list of strings + def getPackagePaths(self, uri): + return { "base": uri } + + def handleRegKey(self, key, intf): + pass + def setPackageSelection(self, anaconda): pass diff --git a/installclasses/fedora.py b/installclasses/fedora.py index afd9d21c1..159ae1361 100644 --- a/installclasses/fedora.py +++ b/installclasses/fedora.py @@ -16,6 +16,8 @@ class InstallClass(BaseInstallClass): sortPriority = 10000 showLoginChoice = 1 showMinimal = 1 + if productName.startswith("Red Hat Enterprise"): + hidden = 1 tasks = [(N_("Office and Productivity"), ["graphics", "office", "games", "sound-and-video"]), (N_("Software Development"), ["development-libs", "development-tools", "gnome-software-development", "x-software-development"],), diff --git a/installclasses/rhel_as.py b/installclasses/rhel_as.py deleted file mode 100644 index 39b36e47b..000000000 --- a/installclasses/rhel_as.py +++ /dev/null @@ -1,42 +0,0 @@ -from installclass import BaseInstallClass -from rhpl.translate import N_, _ -from constants import * -import os -import iutil - -# custom installs are easy :-) -class InstallClass(BaseInstallClass): - name = N_("Red Hat Enterprise Linux AS") - pixmap = "server.png" - description = N_("Red Hat Enterprise Linux AS") - sortPriority = 100 - showLoginChoice = 1 - hidden = 1 - - pkgstext = _("\tDesktop shell (GNOME)\n" - "\tAdministration Tools\n" - "\tServer Configuration Tools\n" - "\tWeb Server\n" - "\tWindows File Server (SMB)\n") - - def setSteps(self, dispatch): - BaseInstallClass.setSteps(self, dispatch); - dispatch.skipStep("desktopchoice", skip = 0) - dispatch.skipStep("package-selection", skip = 1) - - def setGroupSelection(self, anaconda): - BaseInstallClass.__init__(self, anaconda.backend) - - anaconda.backend.unselectAll() - anaconda.backend.selectGroup("server", asMeta = 1) - anaconda.backend.selectGroup("base-x") - anaconda.backend.selectGroup("gnome-desktop") - anaconda.backend.selectGroup("compat-arch-support", asMeta = 1, missingOk = 1) - - def setInstallData(self, anaconda): - BaseInstallClass.setInstallData(self, anaconda) - BaseInstallClass.setDefaultPartitioning(self, anaconda.id.partitions, - CLEARPART_TYPE_ALL) - - def __init__(self, expert): - BaseInstallClass.__init__(self, expert) diff --git a/installclasses/rhel_desktop.py b/installclasses/rhel_desktop.py deleted file mode 100644 index 09dcabd02..000000000 --- a/installclasses/rhel_desktop.py +++ /dev/null @@ -1,43 +0,0 @@ -from installclass import BaseInstallClass -from rhpl.translate import N_, _ -from constants import * -import os -import iutil - -# custom installs are easy :-) -class InstallClass(BaseInstallClass): - name = N_("Red Hat Enterprise Linux Desktop") - pixmap = "workstation.png" - description = N_("Red Hat Enterprise Linux Desktop") - sortPriority = 100 - showLoginChoice = 0 - hidden = 1 - - pkgstext = N_("\tDesktop shell (GNOME)\n" - "\tOffice suite (OpenOffice.org)\n" - "\tWeb browser \n" - "\tEmail (Evolution)\n" - "\tInstant messaging\n" - "\tSound and video applications\n" - "\tGames\n") - - def setSteps(self, dispatch): - BaseInstallClass.setSteps(self, dispatch); - dispatch.skipStep("desktopchoice", skip = 0) - dispatch.skipStep("package-selection", skip = 1) - - def setGroupSelection(self, anaconda): - BaseInstallClass.__init__(self, anaconda) - - anaconda.unselectAll() - anaconda.selectGroup("workstation-common", asMeta = 1) - anaconda.selectGroup("gnome-desktop") - anaconda.selectGroup("compat-arch-support", asMeta = 1, missingOk = 1) - - def setInstallData(self, anaconda): - BaseInstallClass.setInstallData(self, anaconda) - BaseInstallClass.setDefaultPartitioning(self, anaconda.id.partitions, - CLEARPART_TYPE_LINUX) - - def __init__(self, expert): - BaseInstallClass.__init__(self, expert) diff --git a/installclasses/rhel_es.py b/installclasses/rhel_es.py deleted file mode 100644 index 07ffe1d7d..000000000 --- a/installclasses/rhel_es.py +++ /dev/null @@ -1,42 +0,0 @@ -from installclass import BaseInstallClass -from rhpl.translate import N_, _ -from constants import * -import os -import iutil - -# custom installs are easy :-) -class InstallClass(BaseInstallClass): - name = N_("Red Hat Enterprise Linux ES") - pixmap = "server.png" - description = N_("Red Hat Enterprise Linux ES") - sortPriority = 100 - showLoginChoice = 1 - hidden = 1 - - pkgstext = _("\tDesktop shell (GNOME)\n" - "\tAdministration Tools\n" - "\tServer Configuration Tools\n" - "\tWeb Server\n" - "\tWindows File Server (SMB)\n") - - def setSteps(self, dispatch): - BaseInstallClass.setSteps(self, dispatch); - dispatch.skipStep("desktopchoice", skip = 0) - dispatch.skipStep("package-selection", skip = 1) - - def setGroupSelection(self, anaconda): - BaseInstallClass.__init__(self, anaconda.backend) - - anaconda.backend.unselectAll() - anaconda.backend.selectGroup("server", asMeta = 1) - anaconda.backend.selectGroup("base-x") - anaconda.backend.selectGroup("gnome-desktop") - anaconda.backend.selectGroup("compat-arch-support", asMeta = 1, missingOk = 1) - - def setInstallData(self, anaconda): - BaseInstallClass.setInstallData(self, anaconda) - BaseInstallClass.setDefaultPartitioning(self, anaconda.id.partitions, - CLEARPART_TYPE_ALL) - - def __init__(self, expert): - BaseInstallClass.__init__(self, expert) diff --git a/installclasses/rhel_ws.py b/installclasses/rhel_ws.py deleted file mode 100644 index a160714ed..000000000 --- a/installclasses/rhel_ws.py +++ /dev/null @@ -1,47 +0,0 @@ -from installclass import BaseInstallClass -from rhpl.translate import N_, _ -from constants import * -import os -import iutil - -# custom installs are easy :-) -class InstallClass(BaseInstallClass): - name = N_("Red Hat Enterprise Linux WS") - pixmap = "workstation.png" - description = N_("Red Hat Enterprise Linux WS") - sortPriority = 100 - showLoginChoice = 0 - hidden = 1 - - pkgstext = N_("\tDesktop shell (GNOME)\n" - "\tOffice suite (OpenOffice.org)\n" - "\tWeb browser \n" - "\tEmail (Evolution)\n" - "\tInstant messaging\n" - "\tSound and video applications\n" - "\tGames\n" - "\tSoftware Development Tools\n" - "\tAdministration Tools\n") - - def setSteps(self, dispatch): - BaseInstallClass.setSteps(self, dispatch); - dispatch.skipStep("desktopchoice", skip = 0) - dispatch.skipStep("package-selection", skip = 1) - - def setGroupSelection(self, anaconda): - BaseInstallClass.__init__(self, anaconda.backend) - - anaconda.backend.unselectAll() - anaconda.backend.selectGroup("workstation-common", asMeta = 1) - anaconda.backend.selectGroup("gnome-desktop") - anaconda.backend.selectGroup("development-tools") - anaconda.backend.selectGroup("compat-arch-support", asMeta = 1, missingOk = 1) - anaconda.backend.selectGroup("compat-arch-development", asMeta = 1, missingOk = 1) - - def setInstallData(self, anaconda): - BaseInstallClass.setInstallData(self, anaconda) - BaseInstallClass.setDefaultPartitioning(self, anaconda.id.partitions, - CLEARPART_TYPE_LINUX) - - def __init__(self, expert): - BaseInstallClass.__init__(self, expert) diff --git a/packages.py b/packages.py index 4be4e57d4..1f3b67f59 100644 --- a/packages.py +++ b/packages.py @@ -239,6 +239,25 @@ def recreateInitrd (kernelTag, instRoot): stdout = None, stderr = None, searchPath = 1, root = instRoot) +def regKeyScreen(anaconda): + if anaconda.dir == DISPATCH_BACK: + return DISPATCH_NOOP + + while 1: + rc = anaconda.intf.entryWindow(_("Enter Registration Key"), + _("Please enter the registration key for your version of %s.") %(productName,), _("Key:")) + + try: + anaconda.id.instClass.handleRegKey(rc, anaconda.intf) + except Exception, e: + log.info("exception handling regkey: %s" %(e,)) + continue + break + + # FIXME: currently, we only allow this screen to ever be hit _once_ + anaconda.dispatch.skipStep("regkey", permanent = 1) + return + def betaNagScreen(anaconda): publicBetas = { "Red Hat Linux": "Red Hat Linux Public Beta", "Red Hat Enterprise Linux": "Red Hat Enterprise Linux Public Beta", @@ -341,6 +341,15 @@ class InstallInterface: else: return OkCancelWindow(self.screen, title, text) + def entryWindow(self, title, text, prompt, entrylength = None): + (res, value) = EntryWindow(self.screen, title, text, [prompt]) + if res == "cancel": + return None + r = value[0] + r.strip() + return r + + def kickstartErrorWindow(self, text): s = _("The following error was found while parsing your " "kickstart configuration:\n\n%s") %(text,) diff --git a/yuminstall.py b/yuminstall.py index 22595d0e1..628675868 100644 --- a/yuminstall.py +++ b/yuminstall.py @@ -355,10 +355,12 @@ class AnacondaYum(YumSorter): self.conf.cachedir = '/tmp/cache/' self.conf.metadata_expire = 0 - #XXX: It'd be nice if the default repo was in the repoList - repo = AnacondaYumRepo(self.method.getMethodUri()) - repo.enable() - self.repos.add(repo) + # add default repos + for (name, uri) in self.anaconda.id.instClass.getPackagePaths(self.method.getMethodUri()).items(): + repo = AnacondaYumRepo(uri, repoid="anaconda-%s-%s" %(name, productStamp)) + repo.enable() + self.repos.add(repo) + if self.anaconda.isKickstart: for ksrepo in self.anaconda.id.ksdata.repoList: repo = AnacondaYumRepo(uri=ksrepo.baseurl, @@ -678,12 +680,13 @@ class YumBackend(AnacondaBackend): del grps[g] if len(grps.keys()) == 0: + log.info("no groups missing") return c = yum.comps.Category() c.name = _("Uncategorized") c._groups = grps c.categoryid = "uncategorized" - self.ayum.comps.categories.append(c) + self.ayum.comps._categories[c.categoryid] = c def getDefaultGroups(self): import language |