From f3dafc4446cadd6e06882f02fc541102d8aba3ff Mon Sep 17 00:00:00 2001 From: npetrov Date: Fri, 11 Jun 2010 16:37:36 +0200 Subject: [PATCH] adding support to exclude groups (-@fonts) from a default ks file. --- src/pypungi/__init__.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pypungi/__init__.py b/src/pypungi/__init__.py index ba1b31db..c4881e5b 100644 --- a/src/pypungi/__init__.py +++ b/src/pypungi/__init__.py @@ -336,13 +336,16 @@ class Pungi(pypungi.PungiBase): return packages - def _addDefaultGroups(self): + def _addDefaultGroups(self, excludeGroups=[]): """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)) + + groups = [x for x in groups if x not in excludeGroups] + self.logger.debug('Add default groups %s' % groups) return groups @@ -382,16 +385,21 @@ class Pungi(pypungi.PungiBase): final_pkgobjs = {} # The final list of package objects searchlist = [] # The list of package names/globs to search for matchdict = {} # A dict of objects to names + excludeGroups = [] #A list of groups for removal defined in the ks file # First remove the excludes self.ayum.excludePackages() + # Get the groups set for removal + for group in self.ksparser.handler.packages.excludedGroupList: + excludeGroups.append(str(group)[1:]) + # 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(): + for group in self._addDefaultGroups(excludeGroups): self.ksparser.handler.packages.add(['@%s' % group]) # Check to see if we need the base group