diff options
Diffstat (limited to 'instdata.py')
-rw-r--r-- | instdata.py | 53 |
1 files changed, 41 insertions, 12 deletions
diff --git a/instdata.py b/instdata.py index eba4fea4a..53d224e61 100644 --- a/instdata.py +++ b/instdata.py @@ -150,38 +150,67 @@ class InstallData: f.write("\n") packages = {} forcedoff = {} + forcedon = {} for comp in self.comps: if comp.isSelected(): if (comp.isSelected(justManual = 1) and comp.name != "Base" and comp.name != "Core"): f.write("@ %s\n" % comp.name) + for metapkg in comp.metapkgs.keys(): + (type, on) = comp.metapkgs[metapkg] + default = comp.metadef[metapkg] + if on == 1 and default == 0: + f.write("@ %s\n" % metapkg.name) + elif on == 0 and default == 1: + # this isn't quite right + for pkg in metapkg.newpkgDict.keys(): + forcedoff[pkg.name] = 1 + for pkg in comp.newpkgDict.keys(): # if it's in base or core, it really should be installed if comp.name == "Base" or comp.name == "Core": - packages[pkg] = 1 + packages[pkg.name] = 1 elif comp.newpkgDict.has_key(pkg): (type, installed) = comp.newpkgDict[pkg] # if it's mandatory, put it in the dict of ones # already handled if type == 0: - packages[pkg] = 1 - elif comp.depsDict.has_key(pkg.name): - packages[pkg] = 1 + packages[pkg.name] = 1 else: - # otherwise it's optional -- if it's off, we - # should mark it as forced off so that it - # gets listed as such in the comps file - if installed == 0: - forcedoff[pkg] = 1 + if comp.optDict.has_key(pkg): + type = comp.optDict[pkg] + # it's default and selected for installation + if type == 1 and installed == 1: + packages[pkg.name] = 1 + # default and off + elif type == 1 and installed == 0: + forcedoff[pkg.name] = 1 + # optional and on + elif type == 2 and installed == 1: + forcedon[pkg.name] = 1 + # optional and off + elif type == 2 and installed == 0: + pass + else: + # otherwise it's optional -- if it's off, we + # should mark it as forced off so that it + # gets listed as such in the comps file + if installed == 0: + forcedoff[pkg.name] = 1 # or if it's there as a dep, pretend we don't care elif comp.depsDict.has_key(pkg.name): - packages[pkg] = 1 + packages[pkg.name] = 1 + + for pkg in comp.depsDict.keys(): + packages[pkg] = 1 + for pkg in self.hdList.values(): - if not packages.has_key(pkg) and pkg.isSelected(): + if pkg.isSelected() and (forcedon.has_key(pkg.name) or + not packages.has_key(pkg.name)): f.write("%s\n" % pkg.name) - if pkg.wasForcedOff() or forcedoff.has_key(pkg): + if pkg.wasForcedOff() or forcedoff.has_key(pkg.name): f.write("-%s\n" %(pkg.name)) def __init__(self, extraModules, floppyDevice, configFileData, methodstr): |