diff options
author | Chris Johns <chrisj@rtems.org> | 2015-12-10 12:26:49 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2015-12-10 12:26:49 +1100 |
commit | 8b49f734cb06b4862007c10695d19f7e2eebd758 (patch) | |
tree | c6674e61dca3c4af6f7445cd8849461fb4af2946 | |
parent | Add release versioning support. (diff) | |
download | rtems-tools-8b49f734cb06b4862007c10695d19f7e2eebd758.tar.bz2 |
Use the git hash for the revision in the version string.
-rw-r--r-- | wscript | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -36,7 +36,9 @@ subdirs = ['rtemstoolkit', 'tools/gdb/python'] def get_version(ctx): - release = '4.12.not_released' + version = '4.12' + revision = 'not_released' + release = '%s.%s' % (version, revision) if os.path.exists('VERSION'): try: with open('VERSION') as v: @@ -44,6 +46,16 @@ def get_version(ctx): v.close() except: ctx.fatal('cannot access the VERSION file') + else: + from rtemstoolkit import git + repo = git.repo('.') + if repo.valid(): + head = repo.head() + if repo.dirty(): + modified = '_modified' + else: + modified = '' + release = '%s.%s%s)' % (version, head[0:12], modified) last_dot = release.rfind('.') if last_dot == -1: ctx.fatal('invalid VERSION file') @@ -83,6 +95,8 @@ def configure(ctx): except: pass ctx.env.RTEMS_VERSION, ctx.env.RTEMS_RELEASE = get_version(ctx) + ctx.start_msg('Version') + ctx.end_msg('%s (%s)' % (ctx.env.RTEMS_RELEASE, ctx.env.RTEMS_VERSION)) ctx.env.C_OPTS = ctx.options.c_opts.split(',') check_options(ctx, ctx.options.host) recurse(ctx) |