mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 00:59:48 +00:00
bitbake: toaster: Special case the openembedded-core layer to avoid duplicates
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. (Bitbake rev: 8e36b6848c14f2708e1f87d12fb533ca0b596c65) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
e68f63a1bd
commit
0bc0a44aff
@@ -828,6 +828,7 @@ class LayerIndexLayerSource(LayerSource):
|
|||||||
import urllib2, urlparse, json
|
import urllib2, urlparse, json
|
||||||
import os
|
import os
|
||||||
proxy_settings = os.environ.get("http_proxy", None)
|
proxy_settings = os.environ.get("http_proxy", None)
|
||||||
|
oe_core_layer = 'openembedded-core'
|
||||||
|
|
||||||
def _get_json_response(apiurl = self.apiurl):
|
def _get_json_response(apiurl = self.apiurl):
|
||||||
_parsedurl = urlparse.urlparse(apiurl)
|
_parsedurl = urlparse.urlparse(apiurl)
|
||||||
@@ -872,6 +873,25 @@ class LayerIndexLayerSource(LayerSource):
|
|||||||
if not connection.features.autocommits_when_autocommit_is_off:
|
if not connection.features.autocommits_when_autocommit_is_off:
|
||||||
transaction.set_autocommit(False)
|
transaction.set_autocommit(False)
|
||||||
for li in layers_info:
|
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, created = Layer.objects.get_or_create(layer_source = self, name = li['name'])
|
||||||
l.up_id = li['id']
|
l.up_id = li['id']
|
||||||
l.up_date = li['updated']
|
l.up_date = li['updated']
|
||||||
@@ -882,6 +902,7 @@ class LayerIndexLayerSource(LayerSource):
|
|||||||
l.summary = li['summary']
|
l.summary = li['summary']
|
||||||
l.description = li['description']
|
l.description = li['description']
|
||||||
l.save()
|
l.save()
|
||||||
|
|
||||||
if not connection.features.autocommits_when_autocommit_is_off:
|
if not connection.features.autocommits_when_autocommit_is_off:
|
||||||
transaction.set_autocommit(True)
|
transaction.set_autocommit(True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user