X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=wscript;h=9f863d05ed826fdde807a60d70b4c0d067520cd3;hb=78cb780e8cf266e27b0adf6714b9d23f8fbcd796;hp=7e6f616820bc11ab3cd836d62cc521a20fd1ee44;hpb=5918dfa87af3a030173316aabf604e825067eda7;p=libdcp.git diff --git a/wscript b/wscript index 7e6f6168..9f863d05 100644 --- a/wscript +++ b/wscript @@ -1,7 +1,8 @@ import subprocess +import os APPNAME = 'libdcp' -VERSION = '0.03' +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'