diff --git a/utils/update_build_version.py b/utils/update_build_version.py index 0f68bf5e4..98ab5b16d 100755 --- a/utils/update_build_version.py +++ b/utils/update_build_version.py @@ -54,14 +54,14 @@ def command_output(cmd, dir): return stdout -def deduceSoftwareVersion(dir): +def deduce_software_version(dir): """Returns a software version number parsed from the CHANGES file in the given dir. The CHANGES file describes most recent versions first. """ - pattern = re.compile('(v\d+\.\d+(-dev)) \d\d\d\d-\d\d-\d\d$') + pattern = re.compile('(v\d+\.\d+(-dev)?) \d\d\d\d-\d\d-\d\d$') changes_file = os.path.join(dir, 'CHANGES') with open(changes_file) as f: for line in f.readlines(): @@ -99,7 +99,7 @@ def main(): output_file = sys.argv[2] - software_version = deduceSoftwareVersion(sys.argv[1]) + software_version = deduce_software_version(sys.argv[1]) new_content = '"{}", "SPIRV-Tools {} {}"\n'.format( software_version, software_version, describe(sys.argv[1]).replace('"', '\\"'))