summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2015-12-09 19:56:29 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-14 23:13:06 +0000
commit7a0c45e478fac9de2bae63544f7e98187ceb59a7 (patch)
tree0552588396da878af3f3a0487e3f267fd5ca6268 /bitbake/lib/bb
parent9de8dfa11a9d0008fd43bd38f81ab3d65b998033 (diff)
downloadpoky-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.py9
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):
146 prj = Project.objects.get(pk = project_id) 146 prj = Project.objects.get(pk = project_id)
147 147
148 else: # this build was triggered by a legacy system, or command line interactive mode 148 else: # this build was triggered by a legacy system, or command line interactive mode
149 prj = Project.objects.get_default_project() 149 prj = Project.objects.get_or_create_default_project()
150 logger.debug(1, "buildinfohelper: project is not specified, defaulting to %s" % prj) 150 logger.debug(1, "buildinfohelper: project is not specified, defaulting to %s" % prj)
151 151
152 152
@@ -308,6 +308,11 @@ class ORMWrapper(object):
308 # then we are wholly responsible for the data 308 # then we are wholly responsible for the data
309 # and therefore we return the 'real' recipe rather than the build 309 # and therefore we return the 'real' recipe rather than the build
310 # history copy of the recipe. 310 # history copy of the recipe.
311 if recipe_information['layer_version'].build is not None and \
312 recipe_information['layer_version'].build.project == \
313 Project.objects.get_or_create_default_project():
314 return recipe
315
311 if built_recipe is None: 316 if built_recipe is None:
312 return recipe 317 return recipe
313 318
@@ -345,7 +350,7 @@ class ORMWrapper(object):
345 # If we're doing a command line build then associate this new layer with the 350 # If we're doing a command line build then associate this new layer with the
346 # project to avoid it 'contaminating' toaster data 351 # project to avoid it 'contaminating' toaster data
347 project = None 352 project = None
348 if build_obj.project == Project.objects.get_default_project(): 353 if build_obj.project == Project.objects.get_or_create_default_project():
349 project = build_obj.project 354 project = build_obj.project
350 355
351 layer_version_object, _ = Layer_Version.objects.get_or_create( 356 layer_version_object, _ = Layer_Version.objects.get_or_create(