Handle %packages --default to pick up the default groups.

This commit is contained in:
Jesse Keating 2008-10-03 15:32:06 -07:00
parent 15efef64fa
commit b929b89835
1 changed files with 15 additions and 0 deletions

View File

@ -315,6 +315,16 @@ class Pungi(pypungi.PungiBase):
return packages
def _addDefaultGroups(self):
"""Cycle through the groups and return at list of the ones that ara
default."""
# This is mostly stolen from anaconda.
groups = map(lambda x: x.groupid,
filter(lambda x: x.default, self.ayum.comps.groups))
self.logger.debug('Add default groups %s' % groups)
return groups
def getPackageObjects(self):
"""Cycle through the list of packages, get package object
matches, and resolve deps.
@ -332,6 +342,11 @@ class Pungi(pypungi.PungiBase):
# Always add the core group
self.ksparser.handler.packages.add(['@core'])
# Check to see if we want all the defaults
if self.ksparser.handler.packages.default:
for group in self._addDefaultGroups():
self.ksparser.handler.packages.add(['@%s' % group])
# Check to see if we need the base group
if self.ksparser.handler.packages.addBase:
self.ksparser.handler.packages.add(['@base'])