Add missing build aux file for obtaining the git version.

This is needed to make commit e8e7139 work for people that are not me.
This commit is contained in:
Michael James Gratton 2018-01-26 14:39:49 +10:30
parent 9f703466aa
commit eebe498a3e

16
build-aux/git_version.py Executable file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env python3
import re
import sys
import subprocess
try:
version = subprocess.check_output(
['git', 'describe', '--all', '--long', '--dirty'],
stderr=subprocess.DEVNULL
)
except:
sys.exit(1)
version = str(version, encoding='UTF-8').strip()
print(re.sub(r'^heads\/(.*)-0-(g.*)$', r'\1~\2', version))