summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-03-23 08:28:37 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-23 17:53:55 +0000
commit302509214255f7a2b7226e5a6b8a2e361b826168 (patch)
tree5a8b45173765da37da0d682b11c0ca90788aaea9 /bitbake
parent3df6551d8c7963324a0bcd904ca89232d2569ab1 (diff)
downloadpoky-302509214255f7a2b7226e5a6b8a2e361b826168.tar.gz
bitbake: toaster: orm Add a constant for the CustomImageRecipe's layer name
Use a constant to define the name for the toaster custom images layer; this constant is then used to identify this layer in various places. (Bitbake rev: 2540969ec71612af7f9041cadcc401513e9b357b) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/ui/buildinfohelper.py4
-rw-r--r--bitbake/lib/toaster/orm/models.py4
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py2
3 files changed, 7 insertions, 3 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 7fedb76911..bddce4f4b7 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -42,7 +42,7 @@ from orm.models import Variable, VariableHistory
42from orm.models import Package, Package_File, Target_Installed_Package, Target_File 42from orm.models import Package, Package_File, Target_Installed_Package, Target_File
43from orm.models import Task_Dependency, Package_Dependency 43from orm.models import Task_Dependency, Package_Dependency
44from orm.models import Recipe_Dependency, Provides 44from orm.models import Recipe_Dependency, Provides
45from orm.models import Project, CustomImagePackage 45from orm.models import Project, CustomImagePackage, CustomImageRecipe
46 46
47from bldcontrol.models import BuildEnvironment, BuildRequest 47from bldcontrol.models import BuildEnvironment, BuildRequest
48 48
@@ -347,7 +347,7 @@ class ORMWrapper(object):
347 # Special case the toaster-custom-images layer which is created 347 # Special case the toaster-custom-images layer which is created
348 # on the fly so don't update the values which may cause the layer 348 # on the fly so don't update the values which may cause the layer
349 # to be duplicated on a future get_or_create 349 # to be duplicated on a future get_or_create
350 if layer_obj.layer.name == "toaster-custom-images": 350 if layer_obj.layer.name == CustomImageRecipe.LAYER_NAME:
351 return layer_obj 351 return layer_obj
352 # We already found our layer version for this build so just 352 # We already found our layer version for this build so just
353 # update it with the new build information 353 # update it with the new build information
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index add2adea06..0aad788c2a 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -1449,6 +1449,10 @@ class ProjectLayer(models.Model):
1449 unique_together = (("project", "layercommit"),) 1449 unique_together = (("project", "layercommit"),)
1450 1450
1451class CustomImageRecipe(Recipe): 1451class CustomImageRecipe(Recipe):
1452
1453 # CustomImageRecipe's belong to layers called:
1454 LAYER_NAME = "toaster-custom-images"
1455
1452 search_allowed_fields = ['name'] 1456 search_allowed_fields = ['name']
1453 base_recipe = models.ForeignKey(Recipe, related_name='based_on_recipe') 1457 base_recipe = models.ForeignKey(Recipe, related_name='based_on_recipe')
1454 project = models.ForeignKey(Project) 1458 project = models.ForeignKey(Project)
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 85ca9be716..15760b36de 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -2407,7 +2407,7 @@ if True:
2407 2407
2408 # create layer 'Custom layer' and verion if needed 2408 # create layer 'Custom layer' and verion if needed
2409 layer = Layer.objects.get_or_create( 2409 layer = Layer.objects.get_or_create(
2410 name="toaster-custom-images", 2410 name=CustomImageRecipe.LAYER_NAME,
2411 summary="Layer for custom recipes", 2411 summary="Layer for custom recipes",
2412 vcs_url="file:///toaster_created_layer")[0] 2412 vcs_url="file:///toaster_created_layer")[0]
2413 2413