summaryrefslogtreecommitdiff
path: root/wscript
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2018-04-10 13:59:11 +1000
committerChris Johns <chrisj@rtems.org>2018-04-10 13:59:11 +1000
commitc5286cd923f7c0132c4380f481aa34546c3fcc61 (patch)
tree94f0143b766c7cf390b60bf74d15ebe6ac556470 /wscript
parent252d21c8cb6e84f9435c19a9c10dd6b2e3466d38 (diff)
waf: Add getcwd() to sys.path as waf has changed.
Diffstat (limited to 'wscript')
-rw-r--r--wscript15
1 files changed, 13 insertions, 2 deletions
diff --git a/wscript b/wscript
index 0a34d47..0f51f96 100644
--- a/wscript
+++ b/wscript
@@ -1,6 +1,6 @@
#
# RTEMS Tools Project (http://www.rtems.org/)
-# Copyright 2014-2015 Chris Johns (chrisj@rtems.org)
+# Copyright 2014-2018 Chris Johns (chrisj@rtems.org)
# All rights reserved.
#
# This file is part of the RTEMS Tools package in 'rtems-tools'.
@@ -50,7 +50,18 @@ def get_version(ctx):
v.read('VERSION')
release = v.get('version', 'release')
else:
- from rtemstoolkit import git
+ #
+ # waf after 1.9.9 does not place the current directory in Python's
+ # system path which means importing the RTEMS toolkit
+ # fails. Temporarily add it so we can import the git module.
+ #
+ import sys
+ current_sys_path = sys.path
+ try:
+ sys.path = [os.getcwd()] + sys.path
+ from rtemstoolkit import git
+ finally:
+ sys.path = current_sys_path
repo = git.repo('.')
if repo.valid():
head = repo.head()