Skip to content

Commit 7353c48

Browse files
committed
Fixed split ball with extended build version info
1 parent 1977f2d commit 7353c48

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/cygapt/cygapt.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,16 +239,20 @@ def try_itoa(x):
239239
);
240240

241241
def _stringToVersion(self, s):
242+
dashPosition = s.find('-');
243+
build = s[dashPosition + 1:];
244+
s = s[:dashPosition];
242245
s = re.sub(r"([^0-9][^0-9]*)", " \\1 ", s);
243246
s = re.sub(r"[ _.-][ _.-]*", " ", s);
247+
s = s.rstrip(' ');
244248
def try_atoi(x):
245249
if re.match(r"^[0-9]*$", x):
246250
return int(x);
247251
return x
248-
return tuple(map(try_atoi, (s.split(' '))));
252+
return tuple(map(try_atoi, s.split(' ') + [build]));
249253

250254
def _splitBall(self, p):
251-
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);
252256
if not m:
253257
print("splitBall: {0}".format(p));
254258
return (p[:2], (0, 0));

0 commit comments

Comments
 (0)