[yum-cvs] yum/yum __init__.py,1.159,1.160

Seth Vidal skvidal at login.linux.duke.edu
Wed Dec 7 06:13:15 UTC 2005


Update of /home/groups/yum/cvs/yum/yum
In directory login:/tmp/cvs-serv13721/yum

Modified Files:
	__init__.py 
Log Message:

make sure deselectGroup() removes all the packages it added, including
multilib


Index: __init__.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/__init__.py,v
retrieving revision 1.159
retrieving revision 1.160
diff -u -r1.159 -r1.160
--- __init__.py	6 Dec 2005 20:22:33 -0000	1.159
+++ __init__.py	7 Dec 2005 06:13:11 -0000	1.160
@@ -1281,25 +1281,24 @@
         thisgroup = self.comps.groups[grpid]
         thisgroup.selected = False
         
-        for pkg in thisgroup.packages:
-            try:
-                p = self.pkgSack.returnNewestByName(pkg)
-            except mdErrors.PackageSackError:
-                self.log(4, "no such package %s from group %s" %(pkg, thisgroup))
+        for pkgname in thisgroup.packages:
+            p = self.pkgSack.searchNevra(name=pkgname)
+            if not p:
+                self.log(4, "no such package %s from group %s" %(pkgname, thisgroup))
                 continue
             
-            thispkg = p[0]
-            txmbrs = self.tsInfo.getMembers(pkgtup = thispkg.pkgtup)
-            for txmbr in txmbrs:
-                try: 
-                    txmbr.groups.remove(grpid)
-                except ValueError:
-                    self.log(4, "package %s was not marked in group %s" % (thispkg, grpid))
-                    continue
-                
-                # if there aren't any other groups mentioned then remove the pkg
-                if len(txmbr.groups) == 0:
-                    self.tsInfo.remove(thispkg.pkgtup)
+            for po in self.bestPackagesFromList(p):
+                txmbrs = self.tsInfo.getMembers(pkgtup = po.pkgtup)
+                for txmbr in txmbrs:
+                    try: 
+                        txmbr.groups.remove(grpid)
+                    except ValueError:
+                        self.log(4, "package %s was not marked in group %s" % (po, grpid))
+                        continue
+                    
+                    # if there aren't any other groups mentioned then remove the pkg
+                    if len(txmbr.groups) == 0:
+                        self.tsInfo.remove(po.pkgtup)
 
                     
         




More information about the Yum-cvs-commits mailing list