[yum-git] 2 commits - yum/__init__.py yum/yumRepo.py
Seth Vidal
skvidal at linux.duke.edu
Mon Feb 4 05:09:48 UTC 2008
yum/__init__.py | 5 +++++
yum/yumRepo.py | 7 ++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
New commits:
commit 3e1184c8f8c3224e3cef923859104e55643d630e
Merge: 14c6d28... e024114...
Author: Seth Vidal <skvidal at fedoraproject.org>
Date: Mon Feb 4 00:08:17 2008 -0500
Merge branch 'master' of ssh://login.linux.duke.edu/home/groups/yum/git/yum
* 'master' of ssh://login.linux.duke.edu/home/groups/yum/git/yum:
Get the txmbr so we can use it
Another cli to __init__ move fix
Fix installupdate command, from move to __init__, rhbz#431207
fixed typo
Fix misnamed variable
Make it obvious that showdupesfromrepos affects list/info
Make the dirs. we need for the log file
Remove the undocumented config. var yumversion.
Have a single loaded plugins line
* fix problem with skip-broken (rhbz #430936)
* Added multilib skip-broken test case.
commit 14c6d2848fc20cdab1d41c8fde079bfff6a2a2f5
Author: Seth Vidal <skvidal at fedoraproject.org>
Date: Mon Feb 4 00:07:59 2008 -0500
make sure we can happily handle group_gz types in repomd.xml
and make sure comps has something it can cope with, too.
diff --git a/yum/__init__.py b/yum/__init__.py
index 63a8cb0..8e39322 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -30,6 +30,7 @@ import fnmatch
import logging
import logging.config
import operator
+import gzip
try:
from iniparse.compat import ParsingError, ConfigParser
@@ -538,6 +539,10 @@ class YumBase(depsolve.Depsolve):
self.verbose_logger.log(logginglevels.DEBUG_1,
_('Adding group file from repository: %s'), repo)
groupfile = repo.getGroups()
+ # open it up as a file object so iterparse can cope with our gz file
+ if groupfile.endswith('.gz'):
+ groupfile = gzip.open(groupfile)
+
try:
self._comps.add(groupfile)
except (Errors.GroupsError,Errors.CompsException), e:
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index 1a7d918..6e504e2 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -287,7 +287,10 @@ class YumRepository(Repository, config.RepoConf):
def getGroupLocation(self):
"""Returns the location of the group."""
- thisdata = self.repoXML.getData('group')
+ if 'group_gz' in self.repoXML.fileTypes():
+ thisdata = self.repoXML.getData('group_gz')
+ else:
+ thisdata = self.repoXML.getData('group')
return thisdata.location
@@ -1167,6 +1170,8 @@ class YumRepository(Repository, config.RepoConf):
def getGroups(self):
"""gets groups and returns group file path for the repository, if there
is none it returns None"""
+ if 'group_gz' in self.repoXML.fileTypes():
+ return self._retrieveMD('group_gz', retrieve_can_fail=True)
return self._retrieveMD('group', retrieve_can_fail=True)
def setCallback(self, callback):
More information about the Yum-cvs-commits
mailing list