mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-20 22:21:41 +00:00
binman: Use less hard coded magic when inserting new PATH
Instead of joining hard coded '..' to the run-time path of the executable, take just a dirname out of it. Besides that, use $(srctree) where it makes sense. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This commit is contained in:
parent
022f6b0643
commit
33f27f4fad
1 changed files with 7 additions and 5 deletions
|
@ -21,24 +21,26 @@ our_path = os.path.dirname(os.path.realpath(__file__))
|
||||||
our1_path = os.path.dirname(our_path)
|
our1_path = os.path.dirname(our_path)
|
||||||
our2_path = os.path.dirname(our1_path)
|
our2_path = os.path.dirname(our1_path)
|
||||||
|
|
||||||
|
# Extract $(srctree) from Kbuild environment, or use relative paths below
|
||||||
|
srctree = os.environ.get('srctree', our2_path)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Do not pollute source tree with cache files:
|
# Do not pollute source tree with cache files:
|
||||||
# https://stackoverflow.com/a/60024195/2511795
|
# https://stackoverflow.com/a/60024195/2511795
|
||||||
# https://bugs.python.org/issue33499
|
# https://bugs.python.org/issue33499
|
||||||
#
|
#
|
||||||
sys.pycache_prefix = os.path.relpath(our_path, os.environ.get('srctree', our2_path))
|
sys.pycache_prefix = os.path.relpath(our_path, srctree)
|
||||||
|
|
||||||
# Bring in the patman and dtoc libraries (but don't override the first path
|
# Bring in the patman and dtoc libraries (but don't override the first path
|
||||||
# in PYTHONPATH)
|
# in PYTHONPATH)
|
||||||
sys.path.insert(2, os.path.join(our_path, '..'))
|
sys.path.insert(2, our1_path)
|
||||||
|
|
||||||
from patman import test_util
|
from patman import test_util
|
||||||
|
|
||||||
# Bring in the libfdt module
|
# Bring in the libfdt module
|
||||||
sys.path.insert(2, 'scripts/dtc/pylibfdt')
|
sys.path.insert(2, 'scripts/dtc/pylibfdt')
|
||||||
sys.path.insert(2, os.path.join(our_path, '../../scripts/dtc/pylibfdt'))
|
sys.path.insert(2, os.path.join(srctree, 'scripts/dtc/pylibfdt'))
|
||||||
sys.path.insert(2, os.path.join(our_path,
|
sys.path.insert(2, os.path.join(srctree, 'build-sandbox_spl/scripts/dtc/pylibfdt'))
|
||||||
'../../build-sandbox_spl/scripts/dtc/pylibfdt'))
|
|
||||||
|
|
||||||
# When running under python-coverage on Ubuntu 16.04, the dist-packages
|
# When running under python-coverage on Ubuntu 16.04, the dist-packages
|
||||||
# directories are dropped from the python path. Add them in so that we can find
|
# directories are dropped from the python path. Add them in so that we can find
|
||||||
|
|
Loading…
Add table
Reference in a new issue