summaryrefslogtreecommitdiff
path: root/wscript
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-09-27 22:16:27 +0100
committerCarl Hetherington <cth@carlh.net>2018-09-27 22:16:27 +0100
commitdc3db9923f6d8a51002de399843a865cdb853a10 (patch)
treef222817360727f4d005b6cfa3603cad8a8645058 /wscript
parent3243d3175fccdc2074464e2b596cd840dcf5f3a0 (diff)
Fix tarball versioning.
Diffstat (limited to 'wscript')
-rw-r--r--wscript19
1 files changed, 13 insertions, 6 deletions
diff --git a/wscript b/wscript
index 2e0209a..ff44e84 100644
--- a/wscript
+++ b/wscript
@@ -7,13 +7,15 @@ from waflib import Logs
APPNAME = 'libasdcp-cth'
-this_version = subprocess.Popen(shlex.split('git tag -l --points-at HEAD'), stdout=subprocess.PIPE).communicate()[0]
-last_version = subprocess.Popen(shlex.split('git describe --tags --abbrev=0'), stdout=subprocess.PIPE).communicate()[0]
-
-if this_version == '':
- VERSION = '%sdevel' % last_version[1:].strip()
+if os.path.exists('.git'):
+ this_version = subprocess.Popen(shlex.split('git tag -l --points-at HEAD'), stdout=subprocess.PIPE).communicate()[0]
+ last_version = subprocess.Popen(shlex.split('git describe --tags --abbrev=0'), stdout=subprocess.PIPE).communicate()[0]
+ if this_version == '':
+ VERSION = '%sdevel' % last_version[1:].strip()
+ else:
+ VERSION = this_version[1:].strip()
else:
- VERSION = this_version[1:].strip()
+ VERSION = open('VERSION').read().strip()
def options(opt):
opt.load('compiler_cxx')
@@ -101,3 +103,8 @@ def post(ctx):
def tags(bld):
os.system('etags src/*.cc src/*.h')
+
+def dist(bld):
+ f = open('VERSION', 'w')
+ print>>f,VERSION
+ f.close()