From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 5D57DE00FD8; Fri, 25 Sep 2015 11:08:08 -0700 (PDT) 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,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.212.177 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 4E74AE00FCE for ; Fri, 25 Sep 2015 11:07:55 -0700 (PDT) Received: by wicfx3 with SMTP id fx3so29766090wic.0 for ; Fri, 25 Sep 2015 11:07:55 -0700 (PDT) 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=yW1ueYxaqRxkGzGiI6YMyqnG13PVbSiqILaYnpgdO8Q=; b=MZoRlgxIc+h8kpJpCZQbjoH153qklt42sX8IyXpCPrNdi1hAjaRbXDTMUHNe19Bufo FsawQ0qFfXNP5aJ6GDO0N2OM2s0FeIv2I4h/M/9TU009FPnvfqh6O3HPV7O9dUbINZ11 c33y1HSNDhjEsMGx8THpwWIixua+xzgBWCC+ub91JlRysi8KkZWEkDbAAem+mVNNs+JO /UfnPzhsVLAR4TNRcwY9xSykfPHpToeIqEsN2zNzRd6nF2LdpjtdoWqDq4t1u/Ls3nPJ 2oxJioaUqY870MJaRuiP5ADf2BIy+p1mIRGwxRNVVjfMSqiTdc39MHPo8kNXbpanPG3/ bXIA== X-Gm-Message-State: ALoCoQmGbGh0jAfPyGWk5qybPpWq/d+TCfe9kWSVVHEwCWeX9ouuLBQIGvlkbvKlG9F2pAOSmHXR X-Received: by 10.194.82.167 with SMTP id j7mr7692783wjy.123.1443204475079; Fri, 25 Sep 2015 11:07:55 -0700 (PDT) Received: from draco.isw.intel.com ([83.217.123.106]) by smtp.gmail.com with ESMTPSA id uq5sm4511789wjc.3.2015.09.25.11.07.53 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 Sep 2015 11:07:54 -0700 (PDT) From: Michael Wood To: toaster@yoctoproject.org Date: Fri, 25 Sep 2015 19:07:27 +0100 Message-Id: <1443204452-32244-17-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1443204452-32244-1-git-send-email-michael.g.wood@intel.com> References: <1443204452-32244-1-git-send-email-michael.g.wood@intel.com> Subject: [PATCH 16/21] toaster: Special case the openembedded-core layer to avoid duplicates 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, 25 Sep 2015 18:08:08 -0000 If the openembedded-core layer is specified in the toasterconf we need to treat it differently because we may also get this layer either from the layerindex source or I can also be provided locally. Signed-off-by: Michael Wood --- bitbake/lib/toaster/orm/models.py | 21 +++++++++++++++++++++ meta-yocto/conf/toasterconf.json | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 9790630..4025702 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py @@ -828,6 +828,7 @@ class LayerIndexLayerSource(LayerSource): import urllib2, urlparse, json import os proxy_settings = os.environ.get("http_proxy", None) + oe_core_layer = 'openembedded-core' def _get_json_response(apiurl = self.apiurl): _parsedurl = urlparse.urlparse(apiurl) @@ -872,6 +873,25 @@ class LayerIndexLayerSource(LayerSource): if not connection.features.autocommits_when_autocommit_is_off: transaction.set_autocommit(False) for li in layers_info: + # Special case for the openembedded-core layer + if li['name'] == oe_core_layer: + try: + # If we have an existing openembedded-core for example + # from the toasterconf.json augment the info using the + # layerindex rather than duplicate it + oe_core_l = Layer.objects.get(name=oe_core_layer) + # Take ownership of the layer as now coming from the + # layerindex + oe_core_l.layer_source = self + oe_core_l.up_id = li['id'] + oe_core_l.summary = li['summary'] + oe_core_l.description = li['description'] + oe_core_l.save() + continue + + except DoesNotExist: + pass + l, created = Layer.objects.get_or_create(layer_source = self, name = li['name']) l.up_id = li['id'] l.up_date = li['updated'] @@ -882,6 +902,7 @@ class LayerIndexLayerSource(LayerSource): l.summary = li['summary'] l.description = li['description'] l.save() + if not connection.features.autocommits_when_autocommit_is_off: transaction.set_autocommit(True) diff --git a/meta-yocto/conf/toasterconf.json b/meta-yocto/conf/toasterconf.json index c455276..9e45ff0 100644 --- a/meta-yocto/conf/toasterconf.json +++ b/meta-yocto/conf/toasterconf.json @@ -12,7 +12,7 @@ "name": "Local Yocto Project", "sourcetype": "local", "apiurl": "../../", - "branches": ["HEAD", "master", "fido", "dizzy"], + "branches": ["HEAD" ], "layers": [ { "name": "openembedded-core", -- 2.1.4