diff options
-rw-r--r-- | bitbake/lib/toaster/orm/models.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py index 9790630502..4025702fbc 100644 --- a/bitbake/lib/toaster/orm/models.py +++ b/bitbake/lib/toaster/orm/models.py | |||
@@ -828,6 +828,7 @@ class LayerIndexLayerSource(LayerSource): | |||
828 | import urllib2, urlparse, json | 828 | import urllib2, urlparse, json |
829 | import os | 829 | import os |
830 | proxy_settings = os.environ.get("http_proxy", None) | 830 | proxy_settings = os.environ.get("http_proxy", None) |
831 | oe_core_layer = 'openembedded-core' | ||
831 | 832 | ||
832 | def _get_json_response(apiurl = self.apiurl): | 833 | def _get_json_response(apiurl = self.apiurl): |
833 | _parsedurl = urlparse.urlparse(apiurl) | 834 | _parsedurl = urlparse.urlparse(apiurl) |
@@ -872,6 +873,25 @@ class LayerIndexLayerSource(LayerSource): | |||
872 | if not connection.features.autocommits_when_autocommit_is_off: | 873 | if not connection.features.autocommits_when_autocommit_is_off: |
873 | transaction.set_autocommit(False) | 874 | transaction.set_autocommit(False) |
874 | for li in layers_info: | 875 | for li in layers_info: |
876 | # Special case for the openembedded-core layer | ||
877 | if li['name'] == oe_core_layer: | ||
878 | try: | ||
879 | # If we have an existing openembedded-core for example | ||
880 | # from the toasterconf.json augment the info using the | ||
881 | # layerindex rather than duplicate it | ||
882 | oe_core_l = Layer.objects.get(name=oe_core_layer) | ||
883 | # Take ownership of the layer as now coming from the | ||
884 | # layerindex | ||
885 | oe_core_l.layer_source = self | ||
886 | oe_core_l.up_id = li['id'] | ||
887 | oe_core_l.summary = li['summary'] | ||
888 | oe_core_l.description = li['description'] | ||
889 | oe_core_l.save() | ||
890 | continue | ||
891 | |||
892 | except DoesNotExist: | ||
893 | pass | ||
894 | |||
875 | l, created = Layer.objects.get_or_create(layer_source = self, name = li['name']) | 895 | l, created = Layer.objects.get_or_create(layer_source = self, name = li['name']) |
876 | l.up_id = li['id'] | 896 | l.up_id = li['id'] |
877 | l.up_date = li['updated'] | 897 | l.up_date = li['updated'] |
@@ -882,6 +902,7 @@ class LayerIndexLayerSource(LayerSource): | |||
882 | l.summary = li['summary'] | 902 | l.summary = li['summary'] |
883 | l.description = li['description'] | 903 | l.description = li['description'] |
884 | l.save() | 904 | l.save() |
905 | |||
885 | if not connection.features.autocommits_when_autocommit_is_off: | 906 | if not connection.features.autocommits_when_autocommit_is_off: |
886 | transaction.set_autocommit(True) | 907 | transaction.set_autocommit(True) |
887 | 908 | ||