Handle gzipped comps files.
This commit is contained in:
parent
1a5e874d84
commit
eb1a47579f
@ -1,3 +1,6 @@
|
||||
* Thu Feb 21 2008 Jesse Keating <jkeating@redhat.com>
|
||||
- Handle gzipped comps files.
|
||||
|
||||
* Fri Feb 08 2008 Jesse Keating <jkeating@redhat.com>
|
||||
- Fix comps mashup to be more lenient with the open/close of <comps
|
||||
|
||||
|
@ -16,6 +16,7 @@ import yum
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
import gzip
|
||||
import pypungi
|
||||
import logging
|
||||
import urlgrabber.progress
|
||||
@ -389,7 +390,11 @@ class Gather(pypungi.PungiBase):
|
||||
self.logger.warn("No group data found for %s" % repo.id)
|
||||
pass
|
||||
else:
|
||||
compslines = open(groupfile, 'r').readlines()
|
||||
# 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('</comps'):
|
||||
end = compslines.index(line)
|
||||
|
Loading…
Reference in New Issue
Block a user