[oe-commits] [bitbake] 11/20: buildinfohelper: only record image files for tasks which make images
git at git.openembedded.org
git at git.openembedded.org
Tue Jul 19 08:01:15 UTC 2016
rpurdie pushed a commit to branch master
in repository bitbake.
commit 44375d0c2a88e0070b8067c9285b89c54eaf3152
Author: Elliot Smith <elliot.smith at intel.com>
AuthorDate: Tue Jul 12 15:54:49 2016 -0700
buildinfohelper: only record image files for tasks which make images
If a target is built which is classified as an "image" target
(e.g. "core-image-minimal"), Toaster reads the list of files in
the image (from the files-in-image.txt file).
However, Toaster continues to do this for builds which don't
produce images, if the recipe providing the target is an
image recipe. This can result in a list of files in the image
being attached to a target which didn't produce an image (e.g.
rootfs).
When associating files with an image, ensure that only targets
with a task which produces an image have "files in the image"
associated with them.
[YOCTO #9784]
Signed-off-by: Elliot Smith <elliot.smith at intel.com>
Signed-off-by: bavery <brian.avery at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/bb/ui/buildinfohelper.py | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/lib/bb/ui/buildinfohelper.py b/lib/bb/ui/buildinfohelper.py
index bf032ae..52b5e12 100644
--- a/lib/bb/ui/buildinfohelper.py
+++ b/lib/bb/ui/buildinfohelper.py
@@ -875,6 +875,11 @@ class BuildInfoHelper(object):
Keeps in memory all data that needs matching before writing it to the database
"""
+ # tasks which produce image files; note we include '', as we set
+ # the task for a target to '' (i.e. 'build') if no target is
+ # explicitly defined
+ IMAGE_GENERATING_TASKS = ['', 'build', 'image', 'populate_sdk_ext']
+
# pylint: disable=protected-access
# the code will look into the protected variables of the event; no easy way around this
# pylint: disable=bad-continuation
@@ -1235,11 +1240,16 @@ class BuildInfoHelper(object):
logger.warning("KeyError in save_target_package_information"
"%s ", e)
- try:
- self.orm_wrapper.save_target_file_information(self.internal_state['build'], target, filedata)
- except KeyError as e:
- logger.warning("KeyError in save_target_file_information"
- "%s ", e)
+ # only try to find files in the image if the task for this
+ # target is one which produces image files; otherwise, the old
+ # list of files in the files-in-image.txt file will be
+ # appended to the target even if it didn't produce any images
+ if target.task in BuildInfoHelper.IMAGE_GENERATING_TASKS:
+ try:
+ self.orm_wrapper.save_target_file_information(self.internal_state['build'], target, filedata)
+ except KeyError as e:
+ logger.warning("KeyError in save_target_file_information"
+ "%s ", e)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list