diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-07-20 14:18:43 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-07-20 14:18:43 +0100 |
| commit | a33370622510fb3f312516ef602d57743d91bea0 (patch) | |
| tree | 5125ab7ef23f2aeb1081184c2c1a5a18b4613783 /wscript | |
| parent | ef87598f25bbb92702d235a7f4e53a31a2324556 (diff) | |
Tweak version stuff.
Diffstat (limited to 'wscript')
| -rw-r--r-- | wscript | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -27,7 +27,7 @@ def configure(conf): conf.recurse('asdcplib') def build(bld): - create_stored_commit() + create_version_cc(VERSION) bld(source = 'libdcp.pc.in', version = VERSION, @@ -42,19 +42,20 @@ def build(bld): def dist(ctx): ctx.excl = 'TODO core *~ .git build .waf* .lock* doc/*~ src/*~ test/ref/*~' -def create_stored_commit(): +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] try: - text = '#include "git_commit.h"\n' + text = '#include "version.h"\n' text += 'char const * libdcp::git_commit = \"%s\";\n' % commit - print('Writing git commit info to src/git_commit.cc') - o = open('src/git_commit.cc', 'w') + text += 'char const * libdcp::version = \"%s\";\n' % version + print('Writing version information to src/version.cc') + o = open('src/version.cc', 'w') o.write(text) o.close() except IOError: - print('Could not open src/git_commit.cc for writing\n') + print('Could not open src/version.cc for writing\n') sys.exit(-1) |
