summaryrefslogtreecommitdiff
path: root/wscript
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-07-21 15:53:27 +0100
committerCarl Hetherington <cth@carlh.net>2012-07-21 15:53:27 +0100
commit1f1bd0955d449846a1408b9ab2c91761245d494a (patch)
tree52ecad8385b6903d07e42e7295efd215f9a0b459 /wscript
parent4f23449042f4cc64167f38d405b6a2182afae08c (diff)
Try to do the right thing if we aren't in a git checkout.
Diffstat (limited to 'wscript')
-rw-r--r--wscript12
1 files changed, 8 insertions, 4 deletions
diff --git a/wscript b/wscript
index e177d91f..d8113ccd 100644
--- a/wscript
+++ b/wscript
@@ -1,4 +1,5 @@
import subprocess
+import os
APPNAME = 'libdcp'
VERSION = '0.04pre'
@@ -43,10 +44,13 @@ def dist(ctx):
ctx.excl = 'TODO core *~ .git build .waf* .lock* doc/*~ src/*~ test/ref/*~'
def create_version_cc(version):
- cmd = "LANG= git log --abbrev HEAD^..HEAD ."
- output = subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines()
- o = output[0].decode('utf-8')
- commit = o.replace ("commit ", "")[0:10]
+ if os.path.exists('.git'):
+ cmd = "LANG= git log --abbrev HEAD^..HEAD ."
+ output = subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines()
+ o = output[0].decode('utf-8')
+ commit = o.replace ("commit ", "")[0:10]
+ else:
+ commit = "release"
try:
text = '#include "version.h"\n'