Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
192 - 1
"""
2
Copyright 2012 VMware, Inc.  All rights reserved. -- VMware Confidential
3
"""
4
 
5
def CompareVersionString(version0, version1):
6
   """
7
   Compare two version strings
8
 
9
   @param version0: The left-hand version
10
   @param version1: The right-hand version
11
 
12
   @returns: -1 if version0 < version1
13
   @returns:  0 if version0 = version1
14
   @returns:  1 if version0 > version1
15
   """
16
   v0 = version0.split('.')
17
   v1 = version1.split('.')
18
   v0 = [int(x) for x in v0]
19
   v1 = [int(x) for x in v1]
20
   return (v0 > v1) - (v0 < v1)