diff options
| author | Jeremy Katz <katzj@redhat.com> | 2002-02-22 23:36:19 +0000 |
|---|---|---|
| committer | Jeremy Katz <katzj@redhat.com> | 2002-02-22 23:36:19 +0000 |
| commit | b7bcba6bfeb7d83a8563222cdcd91aa1ef14f1f6 (patch) | |
| tree | ebfc28004682e368c8a9011de76f59252fde3698 | |
| parent | 749da07ed84caaaee12bd8c21e8442254f14ebe4 (diff) | |
handle %packages --ignoredeps and %packages --resolvedeps so that people
can control the handling of any spurious dependencies when using kickstart.
if neither is specified, keep the previous behavior (#57297)
| -rw-r--r-- | constants.py | 6 | ||||
| -rw-r--r-- | instdata.py | 10 | ||||
| -rw-r--r-- | kickstart.py | 7 | ||||
| -rw-r--r-- | packages.py | 13 |
4 files changed, 33 insertions, 3 deletions
diff --git a/constants.py b/constants.py index ed24b0436..d527cb630 100644 --- a/constants.py +++ b/constants.py @@ -17,7 +17,6 @@ DISPATCH_BACK = -1 DISPATCH_FORWARD = 1 DISPATCH_NOOP = None - # different types of partition requests # REQUEST_PREEXIST is a placeholder for a pre-existing partition on the system # REQUEST_NEW is a request for a partition which will be automatically @@ -37,3 +36,8 @@ REQUEST_LV = 32 # logical volume CLEARPART_TYPE_LINUX = 1 CLEARPART_TYPE_ALL = 2 CLEARPART_TYPE_NONE = 3 + +# these are used for kickstart +CHECK_DEPS = 0 +IGNORE_DEPS = 1 +RESOLVE_DEPS = 2 diff --git a/instdata.py b/instdata.py index 73121c947..83c46e23b 100644 --- a/instdata.py +++ b/instdata.py @@ -25,6 +25,7 @@ import bootloader import partitions import partedUtils from flags import * +from constants import * from simpleconfig import SimpleConfigFile @@ -67,6 +68,7 @@ class InstallData: self.partitions = partitions.Partitions() self.bootloader = bootloader.getBootloader() self.dependencies = [] + self.handleDeps = CHECK_DEPS self.dbpath = None self.upgradeRoot = None self.upgradeSwapInfo = None @@ -126,7 +128,13 @@ class InstallData: self.bootloader.writeKS(f) self.partitions.writeKS(f) - f.write("\n%packages\n") + f.write("\n%packages") + if self.handleDeps == IGNORE_DEPS: + f.write(" --ignoredeps\n") + elif self.handleDeps == RESOLVE_DEPS: + f.write(" --resolvedeps\n") + else: + f.write("\n") packages = {} for comp in self.comps: if comp.isSelected(): diff --git a/kickstart.py b/kickstart.py index 46c748234..d13e47d16 100644 --- a/kickstart.py +++ b/kickstart.py @@ -6,6 +6,7 @@ from partitioning import * from autopart import * from fsset import * from flags import flags +from constants import * import sys import raid import string @@ -525,6 +526,12 @@ class KickstartBase(BaseInstallClass): scriptInterp = arg elif args and args[0] == "%packages": + if len(args) > 1: + if args[1] == "--resolvedeps": + id.handleDeps = RESOLVE_DEPS + elif args[1] == "--ignoredeps": + id.handleDeps = IGNORE_DEPS + if where =="pre" or where == "post": s = Script(script, scriptInterp, scriptChroot) if where == "pre": diff --git a/packages.py b/packages.py index 5b0e172a2..a0dd0ffc0 100644 --- a/packages.py +++ b/packages.py @@ -161,11 +161,22 @@ def checkDependencies(dir, intf, disp, id, instPath): win.pop() - if id.dependencies and id.comps.canResolveDeps(id.dependencies): + if (id.dependencies and id.comps.canResolveDeps(id.dependencies) + and id.handleDeps == CHECK_DEPS): disp.skipStep("dependencies", skip = 0) else: disp.skipStep("dependencies") + # this is kind of hackish, but makes kickstart happy + if id.handleDeps == CHECK_DEPS: + pass + elif id.handleDeps == IGNORE_DEPS: + id.comps.selectDepCause(id.dependencies) + id.comps.unselectDeps(id.dependencies) + elif id.handleDeps == RESOLVE_DEPS: + id.comps.selectDepCause(id.dependencies) + id.comps.selectDeps(id.dependencies) + #XXX #try: #self.todo.getHeaderList () |
