[rtems-tools commit] Use the git hash for the revision in the version string.
Chris Johns
chrisj at rtems.org
Thu Dec 10 01:27:46 UTC 2015
Module: rtems-tools
Branch: master
Commit: 8b49f734cb06b4862007c10695d19f7e2eebd758
Changeset: http://git.rtems.org/rtems-tools/commit/?id=8b49f734cb06b4862007c10695d19f7e2eebd758
Author: Chris Johns <chrisj at rtems.org>
Date: Thu Dec 10 12:26:49 2015 +1100
Use the git hash for the revision in the version string.
---
wscript | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/wscript b/wscript
index 654845d..d519f06 100644
--- a/wscript
+++ b/wscript
@@ -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)
More information about the vc
mailing list