diff --git a/Changelog b/Changelog index 9c6bf605..61bb545b 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,6 @@ +* Tue Mar 25 2008 Jesse Keating +- Use yum's comps method to write out a unified comps + * Fri Mar 21 2008 Jesse Keating - Handle shared source directory better. diff --git a/src/pypungi/gather.py b/src/pypungi/gather.py index c862e0f0..622f91e3 100755 --- a/src/pypungi/gather.py +++ b/src/pypungi/gather.py @@ -375,45 +375,12 @@ class Gather(pypungi.PungiBase): def makeCompsFile(self): """Gather any comps files we can from repos and merge them into one.""" - # get our list of repos - repos = self.ayum.repos.repos.values() - - compsstub = '\n\n\n' - - closestub = '\n\n' - ourcompspath = os.path.join(self.workdir, '%s-%s-comps.xml' % (self.config.get('default', 'name'), self.config.get('default', 'version'))) ourcomps = open(ourcompspath, 'w') - ourcomps.write(compsstub) + ourcomps.write(self.ayum.comps.Comps.xml()) - # iterate through the list and get what comps we can. - # Strip the first three lines and the last line of substance off - # once done, write it to our comps file - for repo in repos: - try: - groupfile = repo.getGroups() - except yum.Errors.RepoMDError, e: - self.logger.warn("No group data found for %s" % repo.id) - pass - else: - # Check to see if we got a gzipped comps file - if groupfile.endswith('.gz'): - compslines = gzip.open(groupfile, 'r').readlines() - else: - compslines = open(groupfile, 'r').readlines() - for line in compslines: - if line.startswith('