summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-09-28 21:45:31 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-29 14:11:38 +0100
commitfe29297c6a4e3096b0bdecde62a594a8e68f79c5 (patch)
treeb6dc5691e707396df82bdaa6f87bd662e7e90179 /bitbake/lib/bb
parente6d967dba254a9d2a53d8b5b9469ac6b672fb1b9 (diff)
downloadpoky-fe29297c6a4e3096b0bdecde62a594a8e68f79c5.tar.gz
bitbake: Revert "bitbake: toaster: don't re-create Target objects"
This delete followed up the foreign keys and deleted things that were not expected to be deleted. This reverts commit 08000eb27eb8413686fb2c8daf14d234a8bff83a. (Bitbake rev: 46b119eb62a5a612fe4c0847862d34f408e556f7) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r--bitbake/lib/bb/ui/buildinfohelper.py17
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]