Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 45ADDE0083D; Mon, 7 Mar 2016 08:07:08 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.192.174 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mail-pf0-f174.google.com (mail-pf0-f174.google.com [209.85.192.174]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id AFACEE007B5 for ; Mon, 7 Mar 2016 08:07:06 -0800 (PST) Received: by mail-pf0-f174.google.com with SMTP id x188so58276973pfb.2 for ; Mon, 07 Mar 2016 08:07:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LBmvlcTz1zWfSubiss2hkFEMsW8Bf1LYzi/BruZKwiU=; b=1+ZF4jb+/9Hg+qs7sq89AFMkPnKs2cJPwSgW+UmliC9hpc7eIoVC9A0v3tmmPR8hpY SvhLlGC3dmZ/8JS5VwG0mfD//2xq1cxIDENSfm8CsBBwExeXuzWOd+3W3V+upeG9X/Yy wZP1qjMddIw09EYmuQZ5ys5WT0xHTR18ir0bKpBKhGyv/PmU/qG8N/0RDt5cP8mRd6ng 03nRbNlJgdrW6dvRIqKFFyHYObeC4MzM+aQex4vu/EY9c5unHadAXjlJSNQPCaXc5uAE 4+OAA8XFPcNs0bdu/FRO7s9aCHiNRVHxnBfrtwxmLDa7xGxCjnzNE8lQ3FOIRF3X5Cou AhtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LBmvlcTz1zWfSubiss2hkFEMsW8Bf1LYzi/BruZKwiU=; b=jKzT0CnIvJUKwBISxUwTqu/Hjf4HAdGGnGIr39YDynKcjyIrDCWEqgKBtfPX/6yEsN d2/H6FnClM9lu5dP5ZuNJqt2hsxMoeR442+1+andvfueqAZhTs5z++gU/H/9rKSiyiqr g3/kO23+mll8EugN4qO9a/TAGxd2yJ/WBoL7EXcQymlXMh9mNV7FO2fM7T8QC1a4lf1P qhjzTD6b9FbEcIosjsdrjuy1Q59Kv/3by25LMX6nFKwbMxuBvwJz+whrjJcUqmUfsVqC z0GtyyZJsmbBH4prngLJ36CJy+c7tPTcfkuN6DbrenVgBoxUK+6hgYBe3mj4TJU19Vuu 6YDw== X-Gm-Message-State: AD7BkJKchbfb1MJqoAtunDMqZbRfnICHqspKdNgWG3kFEiM56iqizLz5LcNMPczdTAVZ+i0w X-Received: by 10.98.14.207 with SMTP id 76mr9092437pfo.1.1457366826091; Mon, 07 Mar 2016 08:07:06 -0800 (PST) Received: from dorado.ger.corp.intel.com (fmdmzpr02-ext.fm.intel.com. [192.55.55.37]) by smtp.gmail.com with ESMTPSA id yj1sm25182440pac.16.2016.03.07.08.07.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Mar 2016 08:07:05 -0800 (PST) From: Michael Wood To: toaster@yoctoproject.org Date: Mon, 7 Mar 2016 16:03:16 +0000 Message-Id: <1457366599-12973-2-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1457366599-12973-1-git-send-email-michael.g.wood@intel.com> References: <1457114340-16784-1-git-send-email-michael.g.wood@intel.com> <1457366599-12973-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH v2 2/5] toaster: orm Add a constant for the CustomImageRecipe's layer name X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2016 16:07:08 -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 Signed-off-by: Michael Wood --- bitbake/lib/bb/ui/buildinfohelper.py | 4 ++-- bitbake/lib/toaster/orm/models.py | 4 ++++ bitbake/lib/toaster/toastergui/views.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index 81abede..a1af080 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 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 @@ -326,7 +326,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 diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 93b5df3..d451989 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -1430,6 +1430,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) diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index bd11892..de029ef 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py @@ -2392,7 +2392,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] -- 2.5.0