summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Mauch <genone@gentoo.org>2008-05-13 19:36:33 +0000
committerMarius Mauch <genone@gentoo.org>2008-05-13 19:36:33 +0000
commit284000fb7a11b6b58d4908ba180dc32152598b05 (patch)
tree6177bb3980d69d39225cd6cc675c43ca2849bb29
parentfeb69aa5bb31f8960270e984514a6ea4b0682e2c (diff)
downloadportage-284000fb7a11b6b58d4908ba180dc32152598b05.tar.gz
portage-284000fb7a11b6b58d4908ba180dc32152598b05.tar.bz2
portage-284000fb7a11b6b58d4908ba180dc32152598b05.zip
Check vercmp() return value to avoid arbitrary results in case it returns None
svn path=/main/trunk/; revision=10322
-rw-r--r--pym/portage/versions.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pym/portage/versions.py b/pym/portage/versions.py
index 115064578..4a12ef9d5 100644
--- a/pym/portage/versions.py
+++ b/pym/portage/versions.py
@@ -190,9 +190,11 @@ def pkgcmp(pkg1, pkg2):
if pkg1[0] != pkg2[0]:
return None
mycmp = vercmp("-".join(pkg1[1:]), "-".join(pkg2[1:]))
- if mycmp>0:
+ if mycmp is None:
+ return mycmp
+ if mycmp > 0:
return 1
- if mycmp<0:
+ if mycmp < 0:
return -1
return 0