Skip to content

Commit

Permalink
Fixed split ball with extended build version info
Browse files Browse the repository at this point in the history
  • Loading branch information
alquerci committed May 19, 2015
1 parent 1977f2d commit 254cbc0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/cygapt/cygapt.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,19 @@ def try_itoa(x):
);

def _stringToVersion(self, s):
dashPosition = s.find('-');
build = s[dashPosition + 1:];
s = s[:dashPosition];
s = re.sub(r"([^0-9][^0-9]*)", " \\1 ", s);
s = re.sub(r"[ _.-][ _.-]*", " ", s);
def try_atoi(x):
if re.match(r"^[0-9]*$", x):
return int(x);
return x
return tuple(map(try_atoi, (s.split(' '))));
return tuple(map(try_atoi, s.split(' ') + [build]));

def _splitBall(self, p):
m = re.match(r"^(.*)-([0-9].*-[0-9]+)(.tar.(bz2|xz))?$", p);
m = re.match(r"^(.*)-([0-9].*-[0-9]+[.\w]*?)(.tar.(bz2|xz))?$", p);
if not m:
print("splitBall: {0}".format(p));
return (p[:2], (0, 0));
Expand Down

0 comments on commit 254cbc0

Please sign in to comment.