1 parent 1977f2d commit 7353c48Copy full SHA for 7353c48
1 file changed
src/cygapt/cygapt.py
@@ -239,16 +239,20 @@ def try_itoa(x):
239
);
240
241
def _stringToVersion(self, s):
242
+ dashPosition = s.find('-');
243
+ build = s[dashPosition + 1:];
244
+ s = s[:dashPosition];
245
s = re.sub(r"([^0-9][^0-9]*)", " \\1 ", s);
246
s = re.sub(r"[ _.-][ _.-]*", " ", s);
247
+ s = s.rstrip(' ');
248
def try_atoi(x):
249
if re.match(r"^[0-9]*$", x):
250
return int(x);
251
return x
- return tuple(map(try_atoi, (s.split(' '))));
252
+ return tuple(map(try_atoi, s.split(' ') + [build]));
253
254
def _splitBall(self, p):
- m = re.match(r"^(.*)-([0-9].*-[0-9]+)(.tar.(bz2|xz))?$", p);
255
+ m = re.match(r"^(.*)-([0-9].*-[0-9]+[.\w]*?)(.tar.(bz2|xz))?$", p);
256
if not m:
257
print("splitBall: {0}".format(p));
258
return (p[:2], (0, 0));
0 commit comments