[yum-cvs] yum/yum __init__.py,1.310,1.311

Jeremy Katz katzj at linux.duke.edu
Mon Mar 19 21:53:58 UTC 2007


Update of /home/groups/yum/cvs/yum/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv11334/yum

Modified Files:
	__init__.py 
Log Message:
when we close the rpmdb, we need to also ensure that the repos don't think
they're represented in the comps object anymore (rh#230877 and others)


Index: __init__.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/__init__.py,v
retrieving revision 1.310
retrieving revision 1.311
diff -u -r1.310 -r1.311
--- __init__.py	19 Mar 2007 20:21:11 -0000	1.310
+++ __init__.py	19 Mar 2007 21:53:56 -0000	1.311
@@ -292,19 +292,18 @@
         self._ts = None
         self._tsInfo = None
         self._up = None
-        self._comps = None
+        self.comps = None
     
     def _deleteTs(self):
         del self._ts
         self._ts = None
-    
+
     def doRepoSetup(self, thisrepo=None):
         warnings.warn('doRepoSetup() will go away in a future version of Yum.\n',
                 Errors.YumFutureDeprecationWarning, stacklevel=2)
 
         return self._getRepos(thisrepo, True)
-        
-    
+
     def _getRepos(self, thisrepo=None, doSetup = False):
         """grabs the repomd.xml for each enabled repository and sets up 
            the basics of the repository"""
@@ -430,6 +429,14 @@
                 Errors.YumFutureDeprecationWarning, stacklevel=2)
 
         return self._getGroups()
+
+    def _setGroups(self, val):
+        if val is None:
+            # if we unset the comps object, we need to undo which repos have
+            # been added to the group file as well
+            for repo in self.repos.listGroupsEnabled():
+                repo.groups_added = False
+        self._comps = val
     
     def _getGroups(self):
         """create the groups object that will store the comps metadata
@@ -502,7 +509,7 @@
                   fset=lambda self, value: setattr(self, "_up", value),
                   fdel=lambda self: setattr(self, "_up", None))
     comps = property(fget=lambda self: self._getGroups(),
-                     fset=lambda self, value: setattr(self, "_comps", value),
+                     fset=lambda self, value: self._setGroups(self, value),
                      fdel=lambda self: setattr(self, "_comps", None))
     
     




More information about the Yum-cvs-commits mailing list