diff options
author | Chris Johns <chrisj@rtems.org> | 2015-12-11 17:01:51 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2015-12-11 17:01:51 +1100 |
commit | 3828e5033c9a251c2901e67c88e2ef2ea5f69a81 (patch) | |
tree | e94533aa972d3d059e43966fa0872040831dd784 /wscript | |
parent | Use the git hash for the revision in the version string. (diff) | |
download | rtems-tools-3828e5033c9a251c2901e67c88e2ef2ea5f69a81.tar.bz2 |
VERSION as an INI format file.
One section is supported [version] with a 'release' entry.
Diffstat (limited to 'wscript')
-rw-r--r-- | wscript | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -41,11 +41,12 @@ def get_version(ctx): release = '%s.%s' % (version, revision) if os.path.exists('VERSION'): try: - with open('VERSION') as v: - release = v.readline().strip() - v.close() - except: - ctx.fatal('cannot access the VERSION file') + import configparser + except ImportError: + import ConfigParser as configparser + v = configparser.SafeConfigParser() + v.read('VERSION') + release = v.get('version', 'release') else: from rtemstoolkit import git repo = git.repo('.') @@ -55,7 +56,7 @@ def get_version(ctx): modified = '_modified' else: modified = '' - release = '%s.%s%s)' % (version, head[0:12], modified) + release = '%s.%s%s' % (version, head[0:12], modified) last_dot = release.rfind('.') if last_dot == -1: ctx.fatal('invalid VERSION file') |