summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-04-30 07:16:44 +0000
committerZac Medico <zmedico@gentoo.org>2009-04-30 07:16:44 +0000
commit748d96a8fc64824a8a1c136680a5e0ff1835389c (patch)
treedd7e29e16355c019532f22d9ae6785af8bb0bb12
parentBug #266493 - Never return a long from vercmp() since that can trigger an (diff)
downloadportage-multirepo-748d96a8fc64824a8a1c136680a5e0ff1835389c.tar.gz
portage-multirepo-748d96a8fc64824a8a1c136680a5e0ff1835389c.tar.bz2
portage-multirepo-748d96a8fc64824a8a1c136680a5e0ff1835389c.zip
Simplify pkgcmp(). Thanks to Douglas Anderson <dja@gendja.com> for this patch
from bug #266493. (trunk r13354) svn path=/main/branches/2.1.6/; revision=13510
-rw-r--r--pym/portage/versions.py10
1 files changed, 1 insertions, 9 deletions
diff --git a/pym/portage/versions.py b/pym/portage/versions.py
index 13ce4789..29998806 100644
--- a/pym/portage/versions.py
+++ b/pym/portage/versions.py
@@ -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={}