[rtems-tools commit] waf: Fix version paths on Windows.
Chris Johns
chrisj at rtems.org
Wed Nov 28 18:46:19 UTC 2018
Module: rtems-tools
Branch: master
Commit: 95abe76dafb310ea14a6cf5384a506d1525bb7b1
Changeset: http://git.rtems.org/rtems-tools/commit/?id=95abe76dafb310ea14a6cf5384a506d1525bb7b1
Author: Chris Johns <chrisj at rtems.org>
Date: Thu Nov 29 05:40:08 2018 +1100
waf: Fix version paths on Windows.
---
rtemstoolkit/version.py | 8 +++++---
wscript | 3 +++
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/rtemstoolkit/version.py b/rtemstoolkit/version.py
index 54b6af4..82ca95d 100644
--- a/rtemstoolkit/version.py
+++ b/rtemstoolkit/version.py
@@ -115,10 +115,10 @@ def _load_released_version_config():
for ver in [os.path.join(top, 'VERSION'),
os.path.join('..', 'VERSION'),
rtems.configuration_file('rtems-version.ini')]:
- if os.path.exists(os.path.join(ver)):
+ if path.exists(path.join(ver)):
v = configparser.SafeConfigParser()
try:
- v.read(ver)
+ v.read(path.host(ver))
except Exception as e:
raise error.general('Invalid version config format: %s: %s' % (ver,
e))
@@ -245,4 +245,6 @@ def revision():
return _revision
if __name__ == '__main__':
- print('Version: %s' % (str()))
+ print('Version: %s' % (str(version())))
+ if version() == 'undefined':
+ raise Exception('version is undefined')
diff --git a/wscript b/wscript
index c2e55c7..e3aaecb 100644
--- a/wscript
+++ b/wscript
@@ -40,6 +40,9 @@ subdirs = ['rtemstoolkit',
'tools/gdb/python']
def get_version(ctx):
+ #
+ # The file config/rtems-versin.ini contains the version.
+ #
from rtemstoolkit import version as rtemsversion
try:
version = rtemsversion.version()
More information about the vc
mailing list