8 def get_version_from_tag(tag
):
9 m
= re
.match("llvmorg-([0-9]+)\.([0-9]+)\.([0-9]+)(-rc[0-9]+)?$", tag
)
13 return m
.group(1, 2, 3)
14 # We have a final release tag.
15 return (m
.group(1), m
.group(2), str(int(m
.group(3)) + 1))
17 m
= re
.match("llvmorg-([0-9]+)-init", tag
)
19 return (m
.group(1), "0", "0")
21 raise Exception(f
"error: Tag is not valid: {tag}")
28 tag
= repo
.git
.describe(tags
=True, abbrev
=0)
29 expected_version
= ".".join(get_version_from_tag(tag
))
31 if version
!= expected_version
:
32 print("error: Expected version", expected_version
, "but found version", version
)
35 print("Versions match:", version
, expected_version
)