Browse Source
Run git describe during the build to determine the lineage of this working directory and stamp this information into the binary. Change-Id: I0ad24125c31e4280ccf900bac4065924087b05aastable-4.3
Shawn Pearce
9 years ago
2 changed files with 37 additions and 3 deletions
@ -0,0 +1,9 @@
|
||||
def git_version(): |
||||
import subprocess |
||||
cmd = ['git', 'describe', '--always', '--match', 'v[0-9].*', '--dirty'] |
||||
p = subprocess.Popen(cmd, stdout = subprocess.PIPE) |
||||
v = p.communicate()[0].strip() |
||||
r = p.returncode |
||||
if r != 0: |
||||
raise subprocess.CalledProcessError(r, ' '.join(cmd)) |
||||
return v |
Loading…
Reference in new issue