diff options
Diffstat (limited to 'bitbake/lib/bb/ui/buildinfohelper.py')
-rw-r--r-- | bitbake/lib/bb/ui/buildinfohelper.py | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index 2d76403ecc..a8c884de37 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py | |||
@@ -298,9 +298,13 @@ class ORMWrapper(object): | |||
298 | break | 298 | break |
299 | 299 | ||
300 | 300 | ||
301 | 301 | # If we're in analysis mode then we are wholly responsible for the data | |
302 | if created and must_exist: | 302 | # and therefore we return the 'real' recipe rather than the build |
303 | raise NotExisting("Recipe object created when expected to exist", recipe_information) | 303 | # history copy of the recipe. |
304 | if recipe_information['layer_version'].build is not None and \ | ||
305 | recipe_information['layer_version'].build.project == \ | ||
306 | Project.objects.get_default_project(): | ||
307 | return recipe | ||
304 | 308 | ||
305 | return built_recipe | 309 | return built_recipe |
306 | 310 | ||
@@ -333,14 +337,20 @@ class ORMWrapper(object): | |||
333 | assert 'priority' in layer_version_information | 337 | assert 'priority' in layer_version_information |
334 | assert 'local_path' in layer_version_information | 338 | assert 'local_path' in layer_version_information |
335 | 339 | ||
340 | # If we're doing a command line build then associate this new layer with the | ||
341 | # project to avoid it 'contaminating' toaster data | ||
342 | project = None | ||
343 | if build_obj.project == Project.objects.get_default_project(): | ||
344 | project = build_obj.project | ||
345 | |||
336 | layer_version_object, _ = Layer_Version.objects.get_or_create( | 346 | layer_version_object, _ = Layer_Version.objects.get_or_create( |
337 | build = build_obj, | 347 | build = build_obj, |
338 | layer = layer_obj, | 348 | layer = layer_obj, |
339 | branch = layer_version_information['branch'], | 349 | branch = layer_version_information['branch'], |
340 | commit = layer_version_information['commit'], | 350 | commit = layer_version_information['commit'], |
341 | priority = layer_version_information['priority'], | 351 | priority = layer_version_information['priority'], |
342 | local_path = layer_version_information['local_path'], | 352 | local_path = layer_version_information['local_path'], |
343 | ) | 353 | project=project) |
344 | 354 | ||
345 | self.layer_version_objects.append(layer_version_object) | 355 | self.layer_version_objects.append(layer_version_object) |
346 | 356 | ||
@@ -845,7 +855,7 @@ class BuildInfoHelper(object): | |||
845 | logger.warn("Could not match layer version for recipe path %s : %s", path, self.orm_wrapper.layer_version_objects) | 855 | logger.warn("Could not match layer version for recipe path %s : %s", path, self.orm_wrapper.layer_version_objects) |
846 | 856 | ||
847 | #mockup the new layer | 857 | #mockup the new layer |
848 | unknown_layer, _ = Layer.objects.get_or_create(name="__FIXME__unidentified_layer", layer_index_url="") | 858 | unknown_layer, _ = Layer.objects.get_or_create(name="Unidentified layer", layer_index_url="") |
849 | unknown_layer_version_obj, _ = Layer_Version.objects.get_or_create(layer = unknown_layer, build = self.internal_state['build']) | 859 | unknown_layer_version_obj, _ = Layer_Version.objects.get_or_create(layer = unknown_layer, build = self.internal_state['build']) |
850 | 860 | ||
851 | # append it so we don't run into this error again and again | 861 | # append it so we don't run into this error again and again |
@@ -1067,7 +1077,7 @@ class BuildInfoHelper(object): | |||
1067 | task_information['disk_io'] = taskstats['disk_io'] | 1077 | task_information['disk_io'] = taskstats['disk_io'] |
1068 | if 'elapsed_time' in taskstats: | 1078 | if 'elapsed_time' in taskstats: |
1069 | task_information['elapsed_time'] = taskstats['elapsed_time'] | 1079 | task_information['elapsed_time'] = taskstats['elapsed_time'] |
1070 | self.orm_wrapper.get_update_task_object(task_information, True) # must exist | 1080 | self.orm_wrapper.get_update_task_object(task_information) |
1071 | 1081 | ||
1072 | def update_and_store_task(self, event): | 1082 | def update_and_store_task(self, event): |
1073 | assert 'taskfile' in vars(event) | 1083 | assert 'taskfile' in vars(event) |