Bump version.
[libdcp.git] / wscript
diff --git a/wscript b/wscript
index b380dd8d7b4243211cc8dbd879e80b54cf01e2b0..9f863d05ed826fdde807a60d70b4c0d067520cd3 100644 (file)
--- a/wscript
+++ b/wscript
@@ -1,7 +1,8 @@
 import subprocess
+import os
 
 APPNAME = 'libdcp'
-VERSION = '0.03pre'
+VERSION = '0.05pre'
 
 def options(opt):
     opt.load('compiler_cxx')
@@ -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'