Changeset 8b49f73 in rtems-tools


Ignore:
Timestamp:
12/10/15 01:26:49 (8 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.10, 5, master
Children:
3828e50
Parents:
efc4f09
Message:

Use the git hash for the revision in the version string.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wscript

    refc4f09 r8b49f73  
    3737
    3838def get_version(ctx):
    39     release = '4.12.not_released'
     39    version = '4.12'
     40    revision = 'not_released'
     41    release = '%s.%s' % (version, revision)
    4042    if os.path.exists('VERSION'):
    4143        try:
     
    4547        except:
    4648            ctx.fatal('cannot access the VERSION file')
     49    else:
     50        from rtemstoolkit import git
     51        repo = git.repo('.')
     52        if repo.valid():
     53            head = repo.head()
     54            if repo.dirty():
     55                modified = '_modified'
     56            else:
     57                modified = ''
     58            release = '%s.%s%s)' % (version, head[0:12], modified)
    4759    last_dot = release.rfind('.')
    4860    if last_dot == -1:
     
    8496        pass
    8597    ctx.env.RTEMS_VERSION, ctx.env.RTEMS_RELEASE = get_version(ctx)
     98    ctx.start_msg('Version')
     99    ctx.end_msg('%s (%s)' % (ctx.env.RTEMS_RELEASE, ctx.env.RTEMS_VERSION))
    86100    ctx.env.C_OPTS = ctx.options.c_opts.split(',')
    87101    check_options(ctx, ctx.options.host)
Note: See TracChangeset for help on using the changeset viewer.