diff options
-rw-r--r-- | bitbake/lib/bb/ui/buildinfohelper.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index e036ef6dbc..9fdde29e14 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py | |||
@@ -162,6 +162,8 @@ class ORMWrapper(object): | |||
162 | build.bitbake_version=build_info['bitbake_version'] | 162 | build.bitbake_version=build_info['bitbake_version'] |
163 | build.save() | 163 | build.save() |
164 | 164 | ||
165 | Target.objects.filter(build = build).delete() | ||
166 | |||
165 | else: | 167 | else: |
166 | build = Build.objects.create( | 168 | build = Build.objects.create( |
167 | project = prj, | 169 | project = prj, |
@@ -182,6 +184,19 @@ class ORMWrapper(object): | |||
182 | 184 | ||
183 | return build | 185 | return build |
184 | 186 | ||
187 | def create_target_objects(self, target_info): | ||
188 | assert 'build' in target_info | ||
189 | assert 'targets' in target_info | ||
190 | |||
191 | targets = [] | ||
192 | for tgt_name in target_info['targets']: | ||
193 | tgt_object = Target.objects.create( build = target_info['build'], | ||
194 | target = tgt_name, | ||
195 | is_image = False, | ||
196 | ) | ||
197 | targets.append(tgt_object) | ||
198 | return targets | ||
199 | |||
185 | def update_build_object(self, build, errors, warnings, taskfailures): | 200 | def update_build_object(self, build, errors, warnings, taskfailures): |
186 | assert isinstance(build,Build) | 201 | assert isinstance(build,Build) |
187 | assert isinstance(errors, int) | 202 | assert isinstance(errors, int) |
@@ -911,7 +926,7 @@ class BuildInfoHelper(object): | |||
911 | target_information['targets'] = event._pkgs | 926 | target_information['targets'] = event._pkgs |
912 | target_information['build'] = build_obj | 927 | target_information['build'] = build_obj |
913 | 928 | ||
914 | self.internal_state['targets'] = Target.objects.filter(build=target_information['build']) | 929 | self.internal_state['targets'] = self.orm_wrapper.create_target_objects(target_information) |
915 | 930 | ||
916 | # Save build configuration | 931 | # Save build configuration |
917 | data = self.server.runCommand(["getAllKeysWithFlags", ["doc", "func"]])[0] | 932 | data = self.server.runCommand(["getAllKeysWithFlags", ["doc", "func"]])[0] |