waf: Fix version paths on Windows.

This commit is contained in:
Chris Johns 2018-11-29 05:40:08 +11:00
parent 571db94df5
commit 95abe76daf
2 changed files with 8 additions and 3 deletions

View File

@ -115,10 +115,10 @@ def _load_released_version_config():
for ver in [os.path.join(top, 'VERSION'), for ver in [os.path.join(top, 'VERSION'),
os.path.join('..', 'VERSION'), os.path.join('..', 'VERSION'),
rtems.configuration_file('rtems-version.ini')]: rtems.configuration_file('rtems-version.ini')]:
if os.path.exists(os.path.join(ver)): if path.exists(path.join(ver)):
v = configparser.SafeConfigParser() v = configparser.SafeConfigParser()
try: try:
v.read(ver) v.read(path.host(ver))
except Exception as e: except Exception as e:
raise error.general('Invalid version config format: %s: %s' % (ver, raise error.general('Invalid version config format: %s: %s' % (ver,
e)) e))
@ -245,4 +245,6 @@ def revision():
return _revision return _revision
if __name__ == '__main__': if __name__ == '__main__':
print('Version: %s' % (str())) print('Version: %s' % (str(version())))
if version() == 'undefined':
raise Exception('version is undefined')

View File

@ -40,6 +40,9 @@ subdirs = ['rtemstoolkit',
'tools/gdb/python'] 'tools/gdb/python']
def get_version(ctx): def get_version(ctx):
#
# The file config/rtems-versin.ini contains the version.
#
from rtemstoolkit import version as rtemsversion from rtemstoolkit import version as rtemsversion
try: try:
version = rtemsversion.version() version = rtemsversion.version()