Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 0B2ADE00AC5; Fri, 18 Sep 2015 12:05:31 -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.220.47 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id A96A1E006BC for ; Fri, 18 Sep 2015 12:05:28 -0700 (PDT) Received: by pacex6 with SMTP id ex6so58397362pac.0 for ; Fri, 18 Sep 2015 12:05:28 -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=x4aJLd4VtdDmEw9qwtkI+7ZmZBIreBFqE82HcAVMfRA=; b=JeUir+peSyE/o+E+AHGZTAkRR1B2DKjdKItCW+FTXEcnJeTciNOhOyYcIjeYVGXikG lCeYz93N9bb2hSd3duRcrbp3kmpEmMoIf+iINWQopR7j/R0QxPei/9MKNUMBgxQ8+h81 H2Owl2ixO8E5Dti4KR2DZyu+Uj8Lntu9qLtfx5DeeaWSNmsNevMU3E/yD9CBtDTbDozJ 5eNkjRM86Goyp+hEyP+Wrv5muChk8Ztfm3BW4HYLZo/tAvgat4wYUip9bVQQ7D8NL8Pl YUxJU2WJtEEIB0pQiR458fDMXeScCIqw3IFTsG0kQFsfRv+DItTNlDfIJn9agzm5i63h VYQQ== X-Gm-Message-State: ALoCoQnCmdZL7dlxJqHMTRDgONzQXWqGsDTWbJ8YrhSTzfGrWvCMSpMUqV4TNfRBDTlLqrBJaCkL X-Received: by 10.68.69.17 with SMTP id a17mr8803914pbu.10.1442603128601; Fri, 18 Sep 2015 12:05:28 -0700 (PDT) Received: from draco.ger.corp.intel.com (fmdmzpr03-ext.fm.intel.com. [192.55.54.38]) by smtp.gmail.com with ESMTPSA id kh7sm10342357pbc.93.2015.09.18.12.05.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Sep 2015 12:05:27 -0700 (PDT) From: Michael Wood To: toaster@yoctoproject.org Date: Fri, 18 Sep 2015 20:05:04 +0100 Message-Id: <1442603107-31741-1-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <55FC5FA0.20105@intel.com> References: <55FC5FA0.20105@intel.com> Subject: [PATCH 1/4] 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, 18 Sep 2015 19:05:31 -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 e4d2e87..bdb1124 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