diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-07-21 15:55:02 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-07-21 15:55:02 +0100 |
| commit | 0af6137ad0d5bb8904c60457c89770508aa3774a (patch) | |
| tree | 17e0d7acab38975d4ba18397cf5e7a50d9e93e73 | |
| parent | 1f5c67fd46e3c7885c3e7ae2dcdfa7c475d46733 (diff) | |
Try to do the right thing when building in a non-git-checkout.
| -rw-r--r-- | wscript | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -1,4 +1,5 @@ import subprocess +import os APPNAME = 'dvdomatic' VERSION = '0.30pre' @@ -89,10 +90,13 @@ def dist(ctx): ctx.excl = 'TODO core *~ src/gtk/*~ src/lib/*~ .waf* build .git' 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' |
