diff options
| author | Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com> | 2018-01-11 22:55:19 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-01-13 10:15:20 +0000 |
| commit | be5616a27c77d390132f38b1b27af99769aa1155 (patch) | |
| tree | 3273c7a1e72b9c0ee397893cb5794bfffb12cd22 /scripts | |
| parent | 288728e030821ae55cff115a0ca96530ca9a14d2 (diff) | |
| download | poky-be5616a27c77d390132f38b1b27af99769aa1155.tar.gz | |
scripts/wic: use scriptpath module to find bitbake path and oe lib path
Use the scriptpath module in order to standardize the adding of
bitbake and meta/lib path to sys.path.
(From OE-Core rev: 8aba1fd023ce3c6767bf42b9faf9ec14fd7c4d02)
Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/wic | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/scripts/wic b/scripts/wic index 097084a603..0d98875715 100755 --- a/scripts/wic +++ b/scripts/wic | |||
| @@ -43,13 +43,12 @@ from distutils import spawn | |||
| 43 | scripts_path = os.path.abspath(os.path.dirname(__file__)) | 43 | scripts_path = os.path.abspath(os.path.dirname(__file__)) |
| 44 | lib_path = scripts_path + '/lib' | 44 | lib_path = scripts_path + '/lib' |
| 45 | sys.path.insert(0, lib_path) | 45 | sys.path.insert(0, lib_path) |
| 46 | oe_lib_path = os.path.join(os.path.dirname(scripts_path), 'meta', 'lib') | 46 | import scriptpath |
| 47 | sys.path.insert(0, oe_lib_path) | 47 | scriptpath.add_oe_lib_path() |
| 48 | 48 | ||
| 49 | bitbake_exe = spawn.find_executable('bitbake') | 49 | bitbake_exe = spawn.find_executable('bitbake') |
| 50 | if bitbake_exe: | 50 | if bitbake_exe: |
| 51 | bitbake_path = os.path.join(os.path.dirname(bitbake_exe), '../lib') | 51 | bitbake_path = scriptpath.add_bitbake_lib_path() |
| 52 | sys.path.insert(0, bitbake_path) | ||
| 53 | from bb import cookerdata | 52 | from bb import cookerdata |
| 54 | from bb.main import bitbake_main, BitBakeConfigParameters | 53 | from bb.main import bitbake_main, BitBakeConfigParameters |
| 55 | else: | 54 | else: |
