diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-09-27 22:16:27 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-09-27 22:16:27 +0100 |
| commit | dc3db9923f6d8a51002de399843a865cdb853a10 (patch) | |
| tree | f222817360727f4d005b6cfa3603cad8a8645058 /wscript | |
| parent | 3243d3175fccdc2074464e2b596cd840dcf5f3a0 (diff) | |
Fix tarball versioning.
Diffstat (limited to 'wscript')
| -rw-r--r-- | wscript | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -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() |
