diff options
author | Jeremy Katz <katzj@redhat.com> | 2003-01-09 00:22:22 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2003-01-09 00:22:22 +0000 |
commit | 69cded7e3557bbed5c983369943819b28200b297 (patch) | |
tree | ab0eb1bdba26080fe91ad5b850bf009725d531f9 /kickstart.py | |
parent | d7f3ece36c40eb20b4a03dbbf8595b15ba6e9af7 (diff) | |
download | anaconda-69cded7e3557bbed5c983369943819b28200b297.tar.gz anaconda-69cded7e3557bbed5c983369943819b28200b297.tar.xz anaconda-69cded7e3557bbed5c983369943819b28200b297.zip |
by default, if a package or group is listed in a ks.cfg that doesn't exist,
just pop up a dialog to see what the user wants to do about it. add
argument of --ignoremissing for %packages so they can be ignored instead
of prompting
Diffstat (limited to 'kickstart.py')
-rw-r--r-- | kickstart.py | 66 |
1 files changed, 57 insertions, 9 deletions
diff --git a/kickstart.py b/kickstart.py index 1539dc00f..42df57249 100644 --- a/kickstart.py +++ b/kickstart.py @@ -25,6 +25,11 @@ import raid import string import partRequests +from rhpl.translate import _ + +KS_MISSING_PROMPT = 0 +KS_MISSING_IGNORE = 1 + class Script: def __repr__(self): str = ("(s: '%s' i: %s c: %d)") % \ @@ -623,10 +628,13 @@ class KickstartBase(BaseInstallClass): continue if len(args) > 1: - if args[1] == "--resolvedeps": - id.handleDeps = RESOLVE_DEPS - elif args[1] == "--ignoredeps": - id.handleDeps = IGNORE_DEPS + for arg in args[1:]: + if arg == "--resolvedeps": + id.handleDeps = RESOLVE_DEPS + elif arg == "--ignoredeps": + id.handleDeps = IGNORE_DEPS + elif arg == "--ignoremissing": + self.handleMissing = KS_MISSING_IGNORE where = "packages" self.skipSteps.append("package-selection") @@ -1119,20 +1127,56 @@ class KickstartBase(BaseInstallClass): # Note that this assumes setGroupSelection() is called after # setPackageSelection() - def setPackageSelection(self, hdlist): + def setPackageSelection(self, hdlist, intf): for pkg in hdlist.keys(): hdlist[pkg].setState((0, 0)) for n in self.packageList: - hdlist[n].select() + if hdlist.has_key(n): + hdlist[n].select() + elif self.handleMissing == KS_MISSING_IGNORE: + log("package %s doesn't exist, ignoring" %(n,)) + else: + rc = intf.messageWindow(_("Missing Package"), + _("You have specified that the " + "package '%s' should be installed. " + "This package does not exist. " + "Would you like to continue or " + "abort your installation?") %(n,), + type="custom", + custom_buttons=[_("_Abort"), + _("_Continue")]) + if rc == 0: + sys.exit(1) + else: + pass + - def setGroupSelection(self, comps): + def setGroupSelection(self, comps, intf): for comp in comps: comp.unselect() comps['Base'].select() for n in self.groupList: - comps[n].select() + if comps.has_key(n): + comps[n].select() + elif self.handleMissing == KS_MISSING_IGNORE: + log("group %s doesn't exist, ignoring" %(n,)) + else: + rc = intf.messageWindow(_("Missing Group"), + _("You have specified that the " + "group '%s' should be installed. " + "This package does not exist. " + "Would you like to continue or " + "abort your installation?") %(n,), + type="custom", + custom_buttons=[_("_Abort"), + _("_Continue")]) + if rc == 0: + sys.exit(1) + else: + pass + for n in self.excludedList: if comps.packages.has_key(n): @@ -1153,7 +1197,11 @@ class KickstartBase(BaseInstallClass): self.ksPVMapping = {} self.ksVGMapping = {} # XXX hack to give us a starting point for RAID, LVM, etc unique IDs. - self.ksID = 100000 + self.ksID = 100000 + + # how to handle missing packages + self.handleMissing = KS_MISSING_PROMPT + BaseInstallClass.__init__(self, 0) def Kickstart(file, serial): |