diff options
author | Elliot Smith <elliot.smith@intel.com> | 2015-12-09 19:56:29 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-12-14 23:13:06 +0000 |
commit | 7a0c45e478fac9de2bae63544f7e98187ceb59a7 (patch) | |
tree | 0552588396da878af3f3a0487e3f267fd5ca6268 /bitbake/lib/bb | |
parent | 9de8dfa11a9d0008fd43bd38f81ab3d65b998033 (diff) | |
download | openembedded-core-contrib-7a0c45e478fac9de2bae63544f7e98187ceb59a7.tar.gz |
bitbake: toaster: Create default project with get_or_create* method
Rather than maintain data as part of the migrations (as was
done for the default project previously), create the default
(cli builds) project on demand as a by-product of getting
it from the database.
[YOCTO #8364]
(Bitbake rev: 5fd8e90ab9b81d1bd0d301bc1c91228ecbbea74b)
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.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.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index c09955157a..87e03e7c61 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py @@ -146,7 +146,7 @@ class ORMWrapper(object): prj = Project.objects.get(pk = project_id) else: # this build was triggered by a legacy system, or command line interactive mode - prj = Project.objects.get_default_project() + prj = Project.objects.get_or_create_default_project() logger.debug(1, "buildinfohelper: project is not specified, defaulting to %s" % prj) @@ -308,6 +308,11 @@ class ORMWrapper(object): # then we are wholly responsible for the data # and therefore we return the 'real' recipe rather than the build # history copy of the recipe. + if recipe_information['layer_version'].build is not None and \ + recipe_information['layer_version'].build.project == \ + Project.objects.get_or_create_default_project(): + return recipe + if built_recipe is None: return recipe @@ -345,7 +350,7 @@ class ORMWrapper(object): # If we're doing a command line build then associate this new layer with the # project to avoid it 'contaminating' toaster data project = None - if build_obj.project == Project.objects.get_default_project(): + if build_obj.project == Project.objects.get_or_create_default_project(): project = build_obj.project layer_version_object, _ = Layer_Version.objects.get_or_create( |