diff options
-rwxr-xr-x | anaconda | 22 | ||||
-rw-r--r-- | installclass.py | 8 | ||||
-rw-r--r-- | installclasses/upgradeonly.py | 23 | ||||
-rw-r--r-- | todo.py | 4 |
4 files changed, 53 insertions, 4 deletions
@@ -48,7 +48,7 @@ _ = gettext_rh.gettext [ 'gui', 'text', 'reconfig', 'test', 'debug', 'method=', 'rootpath=', 'testpath=', 'mountfs', 'traceonly', 'kickstart=', - 'lang=', 'keymap=', 'kbdtype=', 'module=', + 'lang=', 'keymap=', 'kbdtype=', 'module=', 'class=', 'expert', 'serial' ]) # save because we're about to munge argv @@ -106,6 +106,7 @@ kbdtpye = None kickstart = None mouseInfo = None progmode = None +customClass = None # # parse off command line arguments @@ -158,6 +159,8 @@ for n in args: keymap = arg elif (str == '--kbdtype'): kbdtype = arg + elif (str == '--class'): + customClass = arg # # must specify install or reconfig mode @@ -275,7 +278,22 @@ if traceOnly: sys.exit(0) -if kickstart: +# +# handle class passed from loader +# +if customClass: + import installclass + + instClass = None + classes = installclass.availableClasses(1) + for (className, objectClass, logo) in classes: + if className == customClass: + instClass = objectClass(expert) + + if not instClass: + raise TypeError, "installation class "+customClass+" not available" + sys.exit(0) +elif kickstart: instClass = Kickstart(kickstart, serial) elif reconfigOnly: instClass = ReconfigStation(expert) diff --git a/installclass.py b/installclass.py index c5a334897..631ccfca0 100644 --- a/installclass.py +++ b/installclass.py @@ -16,6 +16,8 @@ from xf86config import XF86Config from translate import _ class BaseInstallClass: + # default to not being hidden + hidden = 0 # look in mouse.py for a list of valid mouse names -- use the LONG names def setMouseType(self, name, device = None, emulateThreeButtons = 0): @@ -256,7 +258,7 @@ class ReconfigStation(BaseInstallClass): allClasses = [] # returns ( className, classObject, classLogo ) tuples -def availableClasses(): +def availableClasses(showhidden=0): global allClasses if allClasses: return allClasses @@ -288,7 +290,9 @@ def availableClasses(): sortOrder = obj.sortPriority else: sortOrder = 0 - list.append(((obj.name, obj, obj.pixmap), sortOrder)) + + if obj.hidden == 0 or showhidden == 1: + list.append(((obj.name, obj, obj.pixmap), sortOrder)) list.sort(ordering) for (item, priority) in list: diff --git a/installclasses/upgradeonly.py b/installclasses/upgradeonly.py new file mode 100644 index 000000000..cf2d1cf91 --- /dev/null +++ b/installclasses/upgradeonly.py @@ -0,0 +1,23 @@ +from installclass import BaseInstallClass +from translate import N_ +import os + +class InstallClass(BaseInstallClass): + name = N_("upgradeonly") + pixmap = "" + hidden = 1 + sortPriority = 1 + + def __init__(self, expert): + BaseInstallClass.__init__(self) + + self.installType = "upgrade" + + self.addToSkipList("bootdisk") + self.addToSkipList("language") + self.addToSkipList("keyboard") + self.addToSkipList("welcome") + self.addToSkipList("package-selection") + self.addToSkipList("confirm-install") + self.addToSkipList("custom-upgrade") + self.addToSkipList("network") @@ -867,6 +867,10 @@ class ToDo: if todo.instClass.desktop: todo.desktop.set (todo.instClass.desktop) + # this is messy, needed for upgradeonly install class + if todo.instClass.installType == "upgrade": + todo.upgrade = 1 + def getPartitionWarningText(self): return self.instClass.clearPartText |