Simplify pkgcmp(). Thanks to Douglas Anderson <dja@gendja.com> for this patch
authorZac Medico <zmedico@gentoo.org>
Sat, 18 Apr 2009 04:45:43 +0000 (04:45 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 18 Apr 2009 04:45:43 +0000 (04:45 -0000)
from bug #266493.

svn path=/main/trunk/; revision=13354

pym/portage/versions.py

index 13ce47897afa1e9d93cf6b0448e3714d6db33ea4..299988061842bce257955588fb96fb2a08ecb7ce 100644 (file)
@@ -203,15 +203,7 @@ def pkgcmp(pkg1, pkg2):
        """
        if pkg1[0] != pkg2[0]:
                return None
-       mycmp = vercmp("-".join(pkg1[1:]), "-".join(pkg2[1:]))
-       if mycmp is None:
-               return mycmp
-       if mycmp > 0:
-               return 1
-       if mycmp < 0:
-               return -1
-       return 0
-
+       return vercmp("-".join(pkg1[1:]), "-".join(pkg2[1:]))
 
 pkgcache={}