ref: f7b7a351084295118143a25000512280b1c9e45b
parent: bef7726b10ec447c73892f5163e2a9e5582caad9
author: Paul Brossier <piem@piem.org>
date: Thu Mar 23 14:07:41 EDT 2017
this_version.py: add +mods if git tree is not clean
--- a/this_version.py
+++ b/this_version.py
@@ -106,8 +106,16 @@
gitcmd.append('--short')
gitcmd.append('HEAD')
try:
- outCmd = subprocess.check_output(gitcmd).strip().decode('utf8')
+ gitsha = subprocess.check_output(gitcmd).strip().decode('utf8')
except Exception as e:
print('git command error :%s' % e)
return None
- return outCmd
+
+ # check if we have a clean tree
+ gitcmd = ['git', '-C', aubio_dir, 'diff-index', '--quiet']
+ gitcmd.append('HEAD')
+ try:
+ subprocess.check_output(gitcmd).strip().decode('utf8')
+ except Exception as e:
+ gitsha += '+mods'
+ return gitsha