correction for setup version string detection

This commit is contained in:
Luke Campagnola 2014-12-24 11:00:00 -05:00
parent 8f638776b3
commit 2357cb427f

View File

@ -360,12 +360,9 @@ def getGitVersion(tagPrefix):
# Find last tag matching "tagPrefix.*"
tagNames = check_output(['git', 'tag'], universal_newlines=True).strip().split('\n')
while True:
if len(tagNames) == 0:
raise Exception("Could not determine last tagged version.")
lastTagName = tagNames.pop()
if re.match(tagPrefix+r'\d+\.\d+.*', lastTagName):
break
tagNames = [x for x in tagNames if re.match(tagPrefix + r'\d+\.\d+\..*', x)]
tagNames.sort(key=lambda s: map(int, s[len(tagPrefix):].split('.')))
lastTagName = tagNames[-1]
gitVersion = lastTagName.replace(tagPrefix, '')
# is this commit an unchanged checkout of the last tagged version?