[yum-git] 2 commits - yum/__init__.py yum/packages.py

James Antill james at linux.duke.edu
Fri Feb 8 21:35:54 UTC 2008


 yum/__init__.py |    5 +++--
 yum/packages.py |   10 +++++-----
 2 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 9393944ccf395198debb7bf735f8b873f7af5b97
Author: James Antill <james at and.org>
Date:   Fri Feb 8 16:34:08 2008 -0500

    Fix pkg.__cmp__ to use comparePoEVR()

diff --git a/yum/packages.py b/yum/packages.py
index b5ed5fa..42c3174 100644
--- a/yum/packages.py
+++ b/yum/packages.py
@@ -180,13 +180,11 @@ class PackageObject(object):
 
     def __cmp__(self, other):
         """ Compare packages. """
+        if not other:
+            return 1
         ret = cmp(self.name, other.name)
         if ret == 0:
-            ret = cmp(self.epoch, other.epoch)
-        if ret == 0:
-            ret = cmp(self.version, other.version)
-        if ret == 0:
-            ret = cmp(self.release, other.release)
+            ret = comparePoEVR(self, other)
         if ret == 0:
             ret = cmp(self.arch, other.arch)
         return ret
@@ -226,6 +224,8 @@ class RpmBase(object):
         self.licenses = []
         self._hash = None
 
+    #  Do we still need __eq__ and __ne__ given that
+    # PackageObject has a working __cmp__?
     def __eq__(self, other):
         if not other: # check if other not is a package object. 
             return False
commit ca5f2f23eb6f480d7df6c75140132e39544d0364
Author: James Antill <james at and.org>
Date:   Fri Feb 8 16:33:26 2008 -0500

    Make exclude processing faster

diff --git a/yum/__init__.py b/yum/__init__.py
index 40c899e..a139d52 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -839,9 +839,10 @@ class YumBase(depsolve.Depsolve):
         else:
             self.verbose_logger.log(logginglevels.INFO_2, _('Excluding Packages from %s'),
                 repo.name)
-        
+
+        pkgs = self._pkgSack.returnPackages(repoid, patterns=excludelist)
         exactmatch, matched, unmatched = \
-           parsePackages(self._pkgSack.returnPackages(repoid), excludelist, casematch=1)
+           parsePackages(pkgs, excludelist, casematch=1)
 
         for po in exactmatch + matched:
             self.verbose_logger.debug('Excluding %s', po)



More information about the Yum-cvs-commits mailing list