projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
feb69aa
)
Check vercmp() return value to avoid arbitrary results in case it returns None
author
Marius Mauch
<genone@gentoo.org>
Tue, 13 May 2008 19:36:33 +0000
(19:36 -0000)
committer
Marius Mauch
<genone@gentoo.org>
Tue, 13 May 2008 19:36:33 +0000
(19:36 -0000)
svn path=/main/trunk/; revision=10322
pym/portage/versions.py
patch
|
blob
|
history
diff --git
a/pym/portage/versions.py
b/pym/portage/versions.py
index 11506457816b8d8a73359e4fc287d1d2d3f74b9e..4a12ef9d596d1e00b6f03c4cfb672f13c2b53223 100644
(file)
--- 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