diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2015-06-26 21:27:31 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-02 23:01:17 +0100 |
commit | 3abe23bd217315246ec2d98dc9c390b85cfe6a92 (patch) | |
tree | 088fc8e061b3008d9ceab7b52175148243e259c2 /scripts/lib/image/engine.py | |
parent | 8becfc2281282a2e63b3bf511936df36315c9cb1 (diff) | |
download | openembedded-core-3abe23bd217315246ec2d98dc9c390b85cfe6a92.tar.gz openembedded-core-3abe23bd217315246ec2d98dc9c390b85cfe6a92.tar.bz2 openembedded-core-3abe23bd217315246ec2d98dc9c390b85cfe6a92.zip |
wic: Refactor getting bitbake variables
Wic gets bitbake variables by parsing output of 'bitbake -e' command.
This implementation improves this procedure as it runs 'bitbake -e' only
when API is called and does it only once, i.e. in a "lazy" way. As parsing
results are cached 'bitbake -e' is run only once and results are parsed
only once per requested set of variables.
get_bitbake_var became the only API call. It replaces find_artifacts,
find_artifact, find_bitbake_env_lines, get_bitbake_env_lines,
set_bitbake_env_lines and get_line_val calls making API much more clear.
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Diffstat (limited to 'scripts/lib/image/engine.py')
-rw-r--r-- | scripts/lib/image/engine.py | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/scripts/lib/image/engine.py b/scripts/lib/image/engine.py index 47950f8d15..92dcc5a4f9 100644 --- a/scripts/lib/image/engine.py +++ b/scripts/lib/image/engine.py @@ -60,29 +60,6 @@ def verify_build_env(): return True -def find_artifacts(image_name): - """ - Gather the build artifacts for the current image (the image_name - e.g. core-image-minimal) for the current MACHINE set in local.conf - """ - bitbake_env_lines = misc.get_bitbake_env_lines() - - rootfs_dir = kernel_dir = bootimg_dir = native_sysroot = "" - - for line in bitbake_env_lines.split('\n'): - if misc.get_line_val(line, "IMAGE_ROOTFS"): - rootfs_dir = misc.get_line_val(line, "IMAGE_ROOTFS") - continue - if misc.get_line_val(line, "DEPLOY_DIR_IMAGE"): - kernel_dir = misc.get_line_val(line, "DEPLOY_DIR_IMAGE") - continue - if misc.get_line_val(line, "STAGING_DIR_NATIVE"): - native_sysroot = misc.get_line_val(line, "STAGING_DIR_NATIVE") - continue - - return (rootfs_dir, kernel_dir, bootimg_dir, native_sysroot) - - CANNED_IMAGE_DIR = "lib/image/canned-wks" # relative to scripts SCRIPTS_CANNED_IMAGE_DIR = "scripts/" + CANNED_IMAGE_DIR |