[Yum-devel] 2 new patches, 1 revised

Bret McMillan bretm at redhat.com
Thu Jun 1 22:59:58 UTC 2006


return-newest-by-name-exception.patch: revised version of the 'return
None' patch... found an exception I missed, and returning []'s
instead.

pkg-sack-base-init.patch: when using yum with a custom repository
class, we ran into trouble where sack.added was expected to be there
(and wasn't).  This makes it work, though discussion around 'added'
would be appreciated; seems particularly designed to get in custom
repo's ways :)

filelists-repoid-key.patch: just another error down the line found
after the PackageSack.__init__ issue was resolved.  Fixes the
assumption that added is always not empty.


Thanks for any feedback :)

--Bret
-------------- next part --------------
Index: yum/packageSack.py
===================================================================
RCS file: /cvsroot/yum/cvs/yum/yum/packageSack.py,v
retrieving revision 1.1
diff -u -r1.1 packageSack.py
--- yum/packageSack.py	28 May 2006 05:32:49 -0000	1.1
+++ yum/packageSack.py	31 May 2006 18:47:57 -0000
@@ -462,7 +463,7 @@
         if (naTup):
             where = self.nevra.get((naTup[0],None,None,None,None))
             if (not where):
-                raise PackageSackError, 'No Package Matching %s.%s' % naTup
+                return []
         else:
             where = self.returnPackages()

@@ -481,7 +481,7 @@
             if highdict.has_key(naTup):
                 return highdict[naTup]
             else:
-                raise PackageSackError, 'No Package Matching %s.%s' % naTup
+                return []
         
         return highdict.values()
         
@@ -508,7 +508,7 @@
             if highdict.has_key(name):
                 return highdict[name]
             else:
-                raise PackageSackError, 'No Package Matching  %s' % name
+                return []
                 
         return highdict.values()
            
-------------- next part --------------
Index: yum/__init__.py
===================================================================
RCS file: /cvsroot/yum/cvs/yum/yum/__init__.py,v
retrieving revision 1.205
diff -u -r1.205 __init__.py
--- yum/__init__.py	30 May 2006 10:15:41 -0000	1.205
+++ yum/__init__.py	1 Jun 2006 16:44:24 -0000
@@ -365,7 +365,7 @@
         
         necessary = False
         for repo in self.repos.listEnabled():
-            if 'filelists' in repo.sack.added[repo.id]:
+            if repo.sack.added.has_key(repo.id) and 'filelists' in repo.sack.added[repo.id]:
                 continue
             else:
                 necessary = True
-------------- next part --------------
Index: yum/packageSack.py
===================================================================
RCS file: /cvsroot/yum/cvs/yum/yum/packageSack.py,v
retrieving revision 1.1
diff -u -r1.1 packageSack.py
--- yum/packageSack.py  28 May 2006 05:32:49 -0000      1.1
+++ yum/packageSack.py  1 Jun 2006 20:29:15 -0000
@@ -249,6 +249,7 @@
 class PackageSack(PackageSackBase):
     """represents sets (sacks) of Package Objects"""
     def __init__(self):
+        PackageSackBase.__init__(self)
         self.nevra = {} #nevra[(Name, Epoch, Version, Release, Arch)] = []
         self.obsoletes = {} #obs[obsoletename] = [pkg1, pkg2, pkg3]
                  #the package lists are packages that obsolete the key name


More information about the Yum-devel mailing list