diff options
author | Michael Wood <michael.g.wood@intel.com> | 2015-09-28 21:45:31 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-09-29 13:44:49 +0100 |
commit | 46b119eb62a5a612fe4c0847862d34f408e556f7 (patch) | |
tree | 0756fa7e078fc5ebe84618806003c7845f2ffc91 /lib | |
parent | 0683d9a2b15e3234a94437aaebac84bfcca1420b (diff) | |
download | bitbake-46b119eb62a5a612fe4c0847862d34f408e556f7.zip |
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.
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 'lib')
-rw-r--r-- | lib/bb/ui/buildinfohelper.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/bb/ui/buildinfohelper.py b/lib/bb/ui/buildinfohelper.py index e036ef6d..9fdde29e 100644 --- a/lib/bb/ui/buildinfohelper.py +++ b/lib/bb/ui/buildinfohelper.py @@ -162,6 +162,8 @@ class ORMWrapper(object): build.bitbake_version=build_info['bitbake_version'] build.save() + Target.objects.filter(build = build).delete() + else: build = Build.objects.create( project = prj, @@ -182,6 +184,19 @@ class ORMWrapper(object): return build + def create_target_objects(self, target_info): + assert 'build' in target_info + assert 'targets' in target_info + + targets = [] + for tgt_name in target_info['targets']: + tgt_object = Target.objects.create( build = target_info['build'], + target = tgt_name, + is_image = False, + ) + targets.append(tgt_object) + return targets + def update_build_object(self, build, errors, warnings, taskfailures): assert isinstance(build,Build) assert isinstance(errors, int) @@ -911,7 +926,7 @@ class BuildInfoHelper(object): target_information['targets'] = event._pkgs target_information['build'] = build_obj - self.internal_state['targets'] = Target.objects.filter(build=target_information['build']) + self.internal_state['targets'] = self.orm_wrapper.create_target_objects(target_information) # Save build configuration data = self.server.runCommand(["getAllKeysWithFlags", ["doc", "func"]])[0] |