Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id F352FE00C30; Fri, 4 Mar 2016 09:59:21 -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.181 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-f181.google.com (mail-pf0-f181.google.com [209.85.192.181]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 59310E00CA1 for ; Fri, 4 Mar 2016 09:59:20 -0800 (PST) Received: by mail-pf0-f181.google.com with SMTP id 124so39274671pfg.0 for ; Fri, 04 Mar 2016 09:59:20 -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=jSyRfCU6k9FBFbYLADYCffV42Q/I4cghN5/Dq9i0Ub0=; b=IbhsYei28Us3rrQPrib68H+4fB6gSZeg+aUCSnBJWaU+upYP+1ecxwxNdObXvJion9 4DNQ5EPbskTK1Otzp2xFl/fU7z/DFttKbkG5DHAbq0NephAEz6I18it7+tpi6ZuxNHlA ldIZEqz6gDSYC87EZvv4h4sYl0ObdCN9aodSN3LFLcxqLEcFBITs4uFiLm4AlsYxn2cC Da4/zSmXHyi1ErDDjUkmV9soZGnDqXY/hTBXP0PO23gjd7T+w/9qVAJ/azVWqBm2nk0K TycRZhHPffY33AOZjRK/hDvPs0LM99DM1F170wMaDp1fHr3zEYX+QoVNYNqrE8Ly8/ty ZloA== 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=jSyRfCU6k9FBFbYLADYCffV42Q/I4cghN5/Dq9i0Ub0=; b=bZI1R7y/KuDOOhnwX5ImWpqFRoGBddrcxE6TLcHKHzUbiVFrMnSH5kj0Ou+v++aR/o aUZu+yE6lmO3P9QDQC1iTGzw70SytNUPX+IKqkJIWS+DGqLl6gGuCsAFlJDjkwSVx4Aq LjbS9mot1C4Q46rQXWXhzwZJCgjuWheRyXYcKAIDG8Qr3wdFLX+1Jdv087IWwEs77B4i AtZ2AyDvDgn5lElw8DSK/GR+ioL75XOTN7AEQdIgXw9a4jhlxamXNzNRsg0ffWvApVqx DprAMkAYdpPmjEiWcZHZwJy9KCIiWgx/Vo/KiKuDO7HM0+tDiF0fCTPFEw5AM5VXPsrc w5qQ== X-Gm-Message-State: AD7BkJJQQIs/zICS98mrequeNmBjF/Z16j9CyPBPQhVU9NP3VsW1q/tnWFZNmq7iG/NuvEZK X-Received: by 10.98.80.22 with SMTP id e22mr13746106pfb.15.1457114360660; Fri, 04 Mar 2016 09:59:20 -0800 (PST) Received: from dorado.ger.corp.intel.com (fmdmzpr04-ext.fm.intel.com. [192.55.55.39]) by smtp.gmail.com with ESMTPSA id 9sm6972342pfc.69.2016.03.04.09.59.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Mar 2016 09:59:20 -0800 (PST) From: Michael Wood To: toaster@yoctoproject.org Date: Fri, 4 Mar 2016 17:58:57 +0000 Message-Id: <1457114340-16784-3-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1457114340-16784-1-git-send-email-michael.g.wood@intel.com> References: <1457114340-16784-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH 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: Fri, 04 Mar 2016 17:59:22 -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 | 2 +- bitbake/lib/toaster/orm/models.py | 4 ++++ bitbake/lib/toaster/toastergui/views.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index 81abede..20ccbc6 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py @@ -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 f3b8d3c..9baa956 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