summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-09-22 10:34:53 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-23 22:44:53 +0100
commit08000eb27eb8413686fb2c8daf14d234a8bff83a (patch)
tree96bdbc38aa0d46ccded568e8c0015c4b047936df
parentea373586d34547747eabf9891a16ac2132d9ff92 (diff)
downloadpoky-08000eb27eb8413686fb2c8daf14d234a8bff83a.tar.gz
bitbake: toaster: don't re-create Target objects
Due to re-creating Target objects from bitbake events task information stored in original objects is lost. There is no valid reason to remove existing objects. It's safer to query them instead of re-creating as original object contain more information than events coming from bitbake. (Bitbake rev: aab4aff75eefb31aa53885d7735feee5daa294aa) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/ui/buildinfohelper.py17
1 files changed, 1 insertions, 16 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 6e313fee8b..e5f1e09978 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -161,8 +161,6 @@ class ORMWrapper(object):
161 build.bitbake_version=build_info['bitbake_version'] 161 build.bitbake_version=build_info['bitbake_version']
162 build.save() 162 build.save()
163 163
164 Target.objects.filter(build = build).delete()
165
166 else: 164 else:
167 build = Build.objects.create( 165 build = Build.objects.create(
168 project = prj, 166 project = prj,
@@ -183,19 +181,6 @@ class ORMWrapper(object):
183 181
184 return build 182 return build
185 183
186 def create_target_objects(self, target_info):
187 assert 'build' in target_info
188 assert 'targets' in target_info
189
190 targets = []
191 for tgt_name in target_info['targets']:
192 tgt_object = Target.objects.create( build = target_info['build'],
193 target = tgt_name,
194 is_image = False,
195 )
196 targets.append(tgt_object)
197 return targets
198
199 def update_build_object(self, build, errors, warnings, taskfailures): 184 def update_build_object(self, build, errors, warnings, taskfailures):
200 assert isinstance(build,Build) 185 assert isinstance(build,Build)
201 assert isinstance(errors, int) 186 assert isinstance(errors, int)
@@ -869,7 +854,7 @@ class BuildInfoHelper(object):
869 target_information['targets'] = event._pkgs 854 target_information['targets'] = event._pkgs
870 target_information['build'] = build_obj 855 target_information['build'] = build_obj
871 856
872 self.internal_state['targets'] = self.orm_wrapper.create_target_objects(target_information) 857 self.internal_state['targets'] = Target.objects.filter(build=target_information['build'])
873 858
874 # Save build configuration 859 # Save build configuration
875 data = self.server.runCommand(["getAllKeysWithFlags", ["doc", "func"]])[0] 860 data = self.server.runCommand(["getAllKeysWithFlags", ["doc", "func"]])[0]