[cwctl] use l.c.changelog for version comparison stable
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Wed, 24 Feb 2010 12:49:55 +0100
branchstable
changeset 4684 876a79ece6f7
parent 4683 c375d50eaad3
child 4696 ce3adab29aef
[cwctl] use l.c.changelog for version comparison
cwctl.py
--- a/cwctl.py	Wed Feb 24 11:11:27 2010 +0100
+++ b/cwctl.py	Wed Feb 24 12:49:55 2010 +0100
@@ -159,14 +159,16 @@
 # base commands ###############################################################
 
 def version_strictly_lower(a,b):
+    from logilab.common.changelog import Version
     if a:
-        a = a.split('.')
+        a = Version(a)
     if b:
-        b = b.split('.')
+        b = Version(b)
     return a < b
 
 def max_version(a, b):
-    return '.'.join(max(a.split('.'), b.split('.')))
+    from logilab.common.changelog import Version
+    return str(max(Version(a), Version(b)))
 
 class ConfigurationProblem(object):
     """Each cube has its own list of dependencies on other cubes/versions.