summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/ui/buildinfohelper.py30
-rw-r--r--bitbake/lib/bb/ui/toasterui.py4
2 files changed, 31 insertions, 3 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 92d1a1c394..46be5a50e4 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -1663,6 +1663,36 @@ class BuildInfoHelper(object):
1663 break 1663 break
1664 return endswith 1664 return endswith
1665 1665
1666 def scan_task_artifacts(self, event):
1667 """
1668 The 'TaskArtifacts' event passes the manifest file content for the
1669 tasks 'do_deploy', 'do_image_complete', 'do_populate_sdk', and
1670 'do_populate_sdk_ext'. The first two will be implemented later.
1671 """
1672 task_vars = BuildInfoHelper._get_data_from_event(event)
1673 task_name = task_vars['task'][task_vars['task'].find(':')+1:]
1674 task_artifacts = task_vars['artifacts']
1675
1676 if task_name in ['do_populate_sdk', 'do_populate_sdk_ext']:
1677 targets = [target for target in self.internal_state['targets'] \
1678 if target.task == task_name[3:]]
1679 if not targets:
1680 logger.warning("scan_task_artifacts: SDK targets not found: %s\n", task_name)
1681 return
1682 for artifact_path in task_artifacts:
1683 if not os.path.isfile(artifact_path):
1684 logger.warning("scan_task_artifacts: artifact file not found: %s\n", artifact_path)
1685 continue
1686 for target in targets:
1687 # don't record the file if it's already been added
1688 # to this target
1689 matching_files = TargetSDKFile.objects.filter(
1690 target=target, file_name=artifact_path)
1691 if matching_files.count() == 0:
1692 artifact_size = os.stat(artifact_path).st_size
1693 self.orm_wrapper.save_target_sdk_file(
1694 target, artifact_path, artifact_size)
1695
1666 def _get_image_files(self, deploy_dir_image, image_name, image_file_extensions): 1696 def _get_image_files(self, deploy_dir_image, image_name, image_file_extensions):
1667 """ 1697 """
1668 Find files in deploy_dir_image whose basename starts with the 1698 Find files in deploy_dir_image whose basename starts with the
diff --git a/bitbake/lib/bb/ui/toasterui.py b/bitbake/lib/bb/ui/toasterui.py
index 17299026ab..71f04fa5ce 100644
--- a/bitbake/lib/bb/ui/toasterui.py
+++ b/bitbake/lib/bb/ui/toasterui.py
@@ -438,9 +438,7 @@ def main(server, eventHandler, params):
438 elif event.type == "SetBRBE": 438 elif event.type == "SetBRBE":
439 buildinfohelper.brbe = buildinfohelper._get_data_from_event(event) 439 buildinfohelper.brbe = buildinfohelper._get_data_from_event(event)
440 elif event.type == "TaskArtifacts": 440 elif event.type == "TaskArtifacts":
441 # not implemented yet 441 buildinfohelper.scan_task_artifacts(event)
442 # see https://bugzilla.yoctoproject.org/show_bug.cgi?id=10283 for details
443 pass
444 elif event.type == "OSErrorException": 442 elif event.type == "OSErrorException":
445 logger.error(event) 443 logger.error(event)
446 else: 444 else: