]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: toaster: orm Add a constant for the CustomImageRecipe's layer name
authorMichael Wood <michael.g.wood@intel.com>
Wed, 23 Mar 2016 08:28:37 +0000 (08:28 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 23 Mar 2016 17:53:55 +0000 (17:53 +0000)
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>
bitbake/lib/bb/ui/buildinfohelper.py
bitbake/lib/toaster/orm/models.py
bitbake/lib/toaster/toastergui/views.py

index 7fedb7691177a05a19f9b83a41e2de73f9ca401d..bddce4f4b79737d00f6570838f09bf9525cf7f55 100644 (file)
@@ -42,7 +42,7 @@ from orm.models import Variable, VariableHistory
 from orm.models import Package, Package_File, Target_Installed_Package, Target_File
 from orm.models import Task_Dependency, Package_Dependency
 from orm.models import Recipe_Dependency, Provides
-from orm.models import Project, CustomImagePackage
+from orm.models import Project, CustomImagePackage, CustomImageRecipe
 
 from bldcontrol.models import BuildEnvironment, BuildRequest
 
@@ -347,7 +347,7 @@ class ORMWrapper(object):
             # Special case the toaster-custom-images layer which is created
             # on the fly so don't update the values which may cause the layer
             # to be duplicated on a future get_or_create
-            if layer_obj.layer.name == "toaster-custom-images":
+            if layer_obj.layer.name == CustomImageRecipe.LAYER_NAME:
                 return layer_obj
             # We already found our layer version for this build so just
             # update it with the new build information
index add2adea06f8f4fb0b2d1cac61b474c9c380a7eb..0aad788c2a4ba4d20ac304a99aa11044a0d321ae 100644 (file)
@@ -1449,6 +1449,10 @@ class ProjectLayer(models.Model):
         unique_together = (("project", "layercommit"),)
 
 class CustomImageRecipe(Recipe):
+
+    # CustomImageRecipe's belong to layers called:
+    LAYER_NAME = "toaster-custom-images"
+
     search_allowed_fields = ['name']
     base_recipe = models.ForeignKey(Recipe, related_name='based_on_recipe')
     project = models.ForeignKey(Project)
index 85ca9be716d151c2fcd719835b72804842d643bb..15760b36de999dff41dc792811503b66bf649318 100755 (executable)
@@ -2407,7 +2407,7 @@ if True:
 
             # create layer 'Custom layer' and verion if needed
             layer = Layer.objects.get_or_create(
-                name="toaster-custom-images",
+                name=CustomImageRecipe.LAYER_NAME,
                 summary="Layer for custom recipes",
                 vcs_url="file:///toaster_created_layer")[0]