diff options
author | Corneliu Stoicescu <corneliux.stoicescu@intel.com> | 2014-07-17 19:11:47 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-07-19 00:09:01 +0100 |
commit | a9710bcfefcfe9fd4293d72b3ca477e397dd3f33 (patch) | |
tree | cefde8fb4ab5be1a31e5b00bd20b61bfe887ad12 /scripts | |
parent | 03e2fb2532780cdca698027f2db244cf737f7544 (diff) | |
download | poky-a9710bcfefcfe9fd4293d72b3ca477e397dd3f33.tar.gz |
scripts/test-remote-image: use the scriptpath module
Use the scripts/lib/scriptpath module in order to standardize the adding of bitbake/lib and meta/lib to sys.path.
(From OE-Core rev: 32c5b31d8a22bb8ba49db8a5c797ad0f421e67a3)
Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/test-remote-image | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/test-remote-image b/scripts/test-remote-image index 8120a6257f..f3a44ebe51 100755 --- a/scripts/test-remote-image +++ b/scripts/test-remote-image | |||
@@ -32,8 +32,15 @@ import logging | |||
32 | import shutil | 32 | import shutil |
33 | from abc import ABCMeta, abstractmethod | 33 | from abc import ABCMeta, abstractmethod |
34 | 34 | ||
35 | # Add path to scripts/lib in sys.path; | ||
36 | scripts_path = os.path.abspath(os.path.dirname(os.path.abspath(sys.argv[0]))) | ||
37 | lib_path = scripts_path + '/lib' | ||
38 | sys.path = sys.path + [lib_path] | ||
39 | |||
40 | import scriptpath | ||
41 | |||
35 | # Add meta/lib to sys.path | 42 | # Add meta/lib to sys.path |
36 | sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'meta/lib'))) | 43 | scriptpath.add_oe_lib_path() |
37 | 44 | ||
38 | import oeqa.utils.ftools as ftools | 45 | import oeqa.utils.ftools as ftools |
39 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var | 46 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var |
@@ -43,7 +50,10 @@ for path in get_bb_var('BBPATH').split(":"): | |||
43 | sys.path.insert(0, os.path.abspath(os.path.join(path, 'lib'))) | 50 | sys.path.insert(0, os.path.abspath(os.path.join(path, 'lib'))) |
44 | 51 | ||
45 | # In order to import modules that contain target controllers, we need the bitbake libraries in sys.path . | 52 | # In order to import modules that contain target controllers, we need the bitbake libraries in sys.path . |
46 | sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'bitbake/lib'))) | 53 | bitbakepath = scriptpath.add_bitbake_lib_path() |
54 | if not bitbakepath: | ||
55 | sys.stderr.write("Unable to find bitbake by searching parent directory of this script or PATH\n") | ||
56 | sys.exit(1) | ||
47 | 57 | ||
48 | # create a logger | 58 | # create a logger |
49 | def logger_create(): | 59 | def logger_create(): |