Lines 49-55
Link Here
|
49 |
return 0 |
49 |
return 0 |
50 |
mykey=ver1+":"+ver2 |
50 |
mykey=ver1+":"+ver2 |
51 |
try: |
51 |
try: |
52 |
return vercmp_cache[mykey] |
52 |
return cmp(vercmp_cache[mykey], 0) |
53 |
except KeyError: |
53 |
except KeyError: |
54 |
pass |
54 |
pass |
55 |
match1 = ver_regexp.match(ver1) |
55 |
match1 = ver_regexp.match(ver1) |
Lines 125-131
Link Here
|
125 |
return 1 |
125 |
return 1 |
126 |
elif list1[i] != list2[i]: |
126 |
elif list1[i] != list2[i]: |
127 |
vercmp_cache[mykey] = list1[i] - list2[i] |
127 |
vercmp_cache[mykey] = list1[i] - list2[i] |
128 |
return list1[i] - list2[i] |
128 |
return cmp(list1[i] - list2[i], 0) |
129 |
|
129 |
|
130 |
# main version is equal, so now compare the _suffix part |
130 |
# main version is equal, so now compare the _suffix part |
131 |
list1 = match1.group(6).split("_")[1:] |
131 |
list1 = match1.group(6).split("_")[1:] |
Lines 142-148
Link Here
|
142 |
else: |
142 |
else: |
143 |
s2 = suffix_regexp.match(list2[i]).groups() |
143 |
s2 = suffix_regexp.match(list2[i]).groups() |
144 |
if s1[0] != s2[0]: |
144 |
if s1[0] != s2[0]: |
145 |
return suffix_value[s1[0]] - suffix_value[s2[0]] |
145 |
return cmp(suffix_value[s1[0]] - suffix_value[s2[0]], 0) |
146 |
if s1[1] != s2[1]: |
146 |
if s1[1] != s2[1]: |
147 |
# it's possible that the s(1|2)[1] == '' |
147 |
# it's possible that the s(1|2)[1] == '' |
148 |
# in such a case, fudge it. |
148 |
# in such a case, fudge it. |
Lines 155-161
Link Here
|
155 |
except ValueError: |
155 |
except ValueError: |
156 |
r2 = 0 |
156 |
r2 = 0 |
157 |
if r1 - r2: |
157 |
if r1 - r2: |
158 |
return r1 - r2 |
158 |
return cmp(r1 - r2, 0) |
159 |
|
159 |
|
160 |
# the suffix part is equal to, so finally check the revision |
160 |
# the suffix part is equal to, so finally check the revision |
161 |
if match1.group(10): |
161 |
if match1.group(10): |