mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-12-28 10:41:04 +00:00
Fix CHANGES file version parsing. -dev is optional
This commit is contained in:
parent
812fb7d798
commit
87125a19c6
@ -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('"', '\\"'))
|
||||
|
Loading…
Reference in New Issue
Block a user