aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2010-07-31 07:36:31 -0300
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2010-07-31 07:36:31 -0300
commitb0e61917179037533fcea89bb154f2074a0534fd (patch)
treebd0adc99a0bb4efcd9f0a3f81ef6bf118d9a5914 /g_octave
parentfixed the tests, that was broken by the previous changes (diff)
downloadg-octave-b0e61917179037533fcea89bb154f2074a0534fd.tar.gz
g-octave-b0e61917179037533fcea89bb154f2074a0534fd.tar.bz2
g-octave-b0e61917179037533fcea89bb154f2074a0534fd.zip
fixed some version comparations
Diffstat (limited to 'g_octave')
-rw-r--r--g_octave/description_tree.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/g_octave/description_tree.py b/g_octave/description_tree.py
index 69da40d..67acd6d 100644
--- a/g_octave/description_tree.py
+++ b/g_octave/description_tree.py
@@ -116,22 +116,22 @@ class DescriptionTree(object):
if pkg['name'] == pkgname:
tmp.append(pkg['version'])
+ tmp.sort(vercmp)
return tmp
def latest_version(self, pkgname):
tmp = self.package_versions(pkgname)
- return self.version_compare(tmp)
+ return tmp[-1]
def version_compare(self, versions):
- max = '0'
- for version in versions:
- if vercmp(max, version) < 0:
- max = version
- return max
+ tmp = list(versions[:])
+ print tmp
+ tmp.sort(vercmp)
+ return tmp[-1]
def packages(self):