Commit 42689147 by Ben Clayton

build_info: Fix parsing of versions with no flavor

parent 9eef54b2
...@@ -100,12 +100,15 @@ def deduce_software_version(directory): ...@@ -100,12 +100,15 @@ def deduce_software_version(directory):
for line in f.readlines(): for line in f.readlines():
match = pattern.match(line) match = pattern.match(line)
if match: if match:
flavor = match.group(4)
if flavor == None:
flavor = ""
return { return {
"major": match.group(1), "major": match.group(1),
"minor": match.group(2), "minor": match.group(2),
"patch": match.group(3), "patch": match.group(3),
"flavor": match.group(4).lstrip("-"), "flavor": flavor.lstrip("-"),
"-flavor": match.group(4), "-flavor": flavor,
"date": match.group(5), "date": match.group(5),
} }
raise Exception('No version number found in {}'.format(changes_file)) raise Exception('No version number found in {}'.format(changes_file))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment