diff options
author | 2010-07-31 07:36:31 -0300 | |
---|---|---|
committer | 2010-07-31 07:36:31 -0300 | |
commit | b0e61917179037533fcea89bb154f2074a0534fd (patch) | |
tree | bd0adc99a0bb4efcd9f0a3f81ef6bf118d9a5914 | |
parent | fixed the tests, that was broken by the previous changes (diff) | |
download | g-octave-b0e61917179037533fcea89bb154f2074a0534fd.tar.gz g-octave-b0e61917179037533fcea89bb154f2074a0534fd.tar.bz2 g-octave-b0e61917179037533fcea89bb154f2074a0534fd.zip |
fixed some version comparations
-rw-r--r-- | g_octave/description_tree.py | 12 |
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): |