Only include groups that are specified in the kickstart. Remove any environments that use groups not on the media.
patch from notting http://lists.fedoraproject.org/pipermail/buildsys/2012-December/004033.html include langpack in comps
This commit is contained in:
parent
feadeaadb8
commit
6cbf093f8e
@ -745,10 +745,29 @@ class Pungi(pypungi.PungiBase):
|
|||||||
|
|
||||||
ourcompspath = os.path.join(self.workdir, '%s-%s-comps.xml' % (self.config.get('pungi', 'name'), self.config.get('pungi', 'version')))
|
ourcompspath = os.path.join(self.workdir, '%s-%s-comps.xml' % (self.config.get('pungi', 'name'), self.config.get('pungi', 'version')))
|
||||||
|
|
||||||
|
# Filter out things we don't include
|
||||||
|
ourgroups = []
|
||||||
|
for item in self.ksparser.handler.packages.groupList:
|
||||||
|
g = self.ayum.comps.return_group(item.name)
|
||||||
|
if g:
|
||||||
|
ourgroups.append(g.groupid)
|
||||||
|
allgroups = [g.groupid for g in self.ayum.comps.get_groups()]
|
||||||
|
for group in allgroups:
|
||||||
|
if group not in ourgroups and not self.ayum.comps.return_group(group).langonly:
|
||||||
|
self.logger.info('Removing extra group %s from comps file' % (group,))
|
||||||
|
del self.ayum.comps._groups[group]
|
||||||
|
|
||||||
|
groups = [g.groupid for g in self.ayum.comps.get_groups()]
|
||||||
|
envs = self.ayum.comps.get_environments()
|
||||||
|
for env in envs:
|
||||||
|
for group in env.groups:
|
||||||
|
if group not in groups:
|
||||||
|
self.logger.info('Removing incomplete environment %s from comps file' % (env,))
|
||||||
|
del self.ayum.comps._environments[env.environmentid]
|
||||||
|
break
|
||||||
|
|
||||||
ourcomps = open(ourcompspath, 'w')
|
ourcomps = open(ourcompspath, 'w')
|
||||||
|
|
||||||
ourcomps.write(self.ayum.comps.xml())
|
ourcomps.write(self.ayum.comps.xml())
|
||||||
|
|
||||||
ourcomps.close()
|
ourcomps.close()
|
||||||
|
|
||||||
# Disable this until https://bugzilla.redhat.com/show_bug.cgi?id=442097 is fixed.
|
# Disable this until https://bugzilla.redhat.com/show_bug.cgi?id=442097 is fixed.
|
||||||
|
Loading…
Reference in New Issue
Block a user