yocto-bsp: insert the path of argparse_oe.py into libpath
PATCH 1/1 yocto-bsp: insert the path of argparse_oe.py into libpath
Issue: LIN9-4616
Finding the path of argparse_oe.py in env PATH. Usually, it can be found in project/scripts/lib, or oe-core/scripts/lib. Find the first one and insert it into libpath.
(LOCAL REV: NOT UPSTREAM) -- pending
Signed-off-by Robert Yang <[email protected]>
Signed-off-by Yue Tao <[email protected]>
--- scripts/yocto-bsp | 7 +++++++ 1 file changed, 7 insertions(+)
scripts/yocto-bsp +7 -0
@@ -35,6 +35,13 @@ import sys import argparse import logging +path_from_env = os.getenv('PATH').split(':') +for script_path in path_from_env: + if script_path.endswith('scripts'): + if os.path.exists(os.path.join(script_path, 'lib/argparse_oe.py')): + sys.path.insert(0, script_path + '/lib') + break + scripts_path = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, scripts_path + '/lib') import argparse_oe
Signature · 1 line
1.7.9.5