[oe] [meta-yocto][PATCH] yocto-bsp: insert the path of argparse_oe.py into libpath

Yue Tao Yue.Tao at windriver.com
Fri Jul 14 08:37:08 UTC 2017


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 <liezhi.yang at windriver.com>
Signed-off-by: Yue Tao <Yue.Tao at windriver.com>
---
 scripts/yocto-bsp |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/scripts/yocto-bsp b/scripts/yocto-bsp
index 6fb1f41..fdd3ed2 100755
--- a/scripts/yocto-bsp
+++ b/scripts/yocto-bsp
@@ -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
-- 
1.7.9.5




More information about the Openembedded-devel mailing list