Skip to contentSkip to conversation

wic: insert local Python paths at front

PATCH In review Matt Madison 2 participants 2 messages Dec 6, 2015 – Dec 7, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wic: insert local Python paths at front

This follows how bitbake performs path insertion, and fixes a failure to start wic on Ubuntu 15.10 with the distribution's version of python-ply installed.

---
 scripts/wic | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/wic +2 -2
index 7ad2b19..2286f20 100755
@@ -41,12 +41,12 @@ from distutils import spawn
 # External modules
 scripts_path = os.path.abspath(os.path.dirname(__file__))
 lib_path = scripts_path + '/lib'
-sys.path.append(lib_path)
+sys.path.insert(0, lib_path)
 
 bitbake_exe = spawn.find_executable('bitbake')
 if bitbake_exe:
     bitbake_path = os.path.join(os.path.dirname(bitbake_exe), '../lib')
-    sys.path.append(bitbake_path)
+    sys.path.insert(0, bitbake_path)
     from bb import cookerdata
     from bb.main import bitbake_main, BitBakeConfigParameters
 else:
Signature · 1 line
2.5.0
Acked-by on v1 1/1
#1 lore raw

Hi Matt,

Thank you for the patch!

Quoted 36 lines · Matt Madison

This follows how bitbake performs path insertion, and fixes a failure to start wic on Ubuntu 15.10 with the distribution's version of python-ply installed.

---
 scripts/wic | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/wic +2 -2
index 7ad2b19..2286f20 100755
@@ -41,12 +41,12 @@ from distutils import spawn
 # External modules
 scripts_path = os.path.abspath(os.path.dirname(__file__))
 lib_path = scripts_path + '/lib'
-sys.path.append(lib_path)
+sys.path.insert(0, lib_path)
 
 bitbake_exe = spawn.find_executable('bitbake')
 if bitbake_exe:
     bitbake_path = os.path.join(os.path.dirname(bitbake_exe), '../lib')
-    sys.path.append(bitbake_path)
+    sys.path.insert(0, bitbake_path)
     from bb import cookerdata
     from bb.main import bitbake_main, BitBakeConfigParameters
 else:
Signature · 7 lines
2.5.0

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

--
Regards,
Ed