layerindex-web/layerindex/layerconfparse.py
Mark Hatle c91372587b update.py: Allow bitbake to live in a subdirectory of a repository
Add a new BITBAKE_PATH to the settings file to specify the path within the
BITBAKE_REPO_URL where bitbake lives.  This is useful when using a combined
repository, such as poky, that contains bitbake, openembedded-core and other
layers.

This change also changes the default path, in the fetch directory, for the
bitbake checkout.  It no longer uses the path 'bitbake', but instead uses the
same URL processing as the layer fetching.

There is a side effect that, when using a shared fetch, the branch of the
layer will be used instead of the specified bitbake branch.  Generally this
is a reasonable compromise, since in a combined repository bitbake and
openembedded-core component should already match.

Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-10-14 09:20:14 +13:00

54 lines
1.6 KiB
Python

# Utility functions for parsing layer.conf using bitbake within layerindex-web
#
# Copyright (C) 2016 Wind River Systems
# Author: Liam R. Howlett <liam.howlett@windriver.com>
#
# Licensed under the MIT license, see COPYING.MIT for details
#
import sys
import os
import os.path
import utils
import tempfile
import re
class LayerConfParse:
def __init__(self, enable_tracking=False, logger=None, bitbakepath=None, tinfoil=None):
import settings
self.logger = logger
if not bitbakepath:
fetchdir = settings.LAYER_FETCH_DIR
from layerindex.models import LayerItem
bitbakeitem = LayerItem()
bitbakeitem.vcs_url = settings.BITBAKE_REPO_URL
bitbakepath = os.path.join(fetchdir, bitbakeitem.get_fetch_dir())
if getattr(settings, 'BITBAKE_PATH', ''):
bitbakepath = os.path.join(bitbakepath, settings.BITBAKE_PATH)
self.bbpath = bitbakepath
# Set up BBPATH.
os.environ['BBPATH'] = str("%s" % self.bbpath)
self.tinfoil = tinfoil
if not self.tinfoil:
self.tinfoil = utils.setup_tinfoil(self.bbpath, enable_tracking)
self.config_data_copy = bb.data.createCopy(self.tinfoil.config_data)
def parse_layer(self, layerdir):
# This is not a valid layer, parsing will cause exception.
if not utils.is_layer_valid(layerdir):
return None
utils.parse_layer_conf(layerdir, self.config_data_copy, logger=self.logger)
return self.config_data_copy
def shutdown(self):
self.tinfoil.shutdown()