mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
utils.py: split out parse_conf() from parse_layer_conf()
If we want to parse a configuration file (e.g. a distro conf file) then we need convenient access to bitbake's conf parsing code, so create a parse_conf() function to provide that. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
c8c25fb641
commit
d62b84f593
|
@ -160,6 +160,15 @@ def is_layer_valid(layerdir):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def parse_conf(conf_file, d):
|
||||||
|
if hasattr(bb.parse, "handle"):
|
||||||
|
# Newer BitBake
|
||||||
|
data = bb.parse.handle(conf_file, d, include=True)
|
||||||
|
else:
|
||||||
|
# Older BitBake (1.18 and below)
|
||||||
|
data = bb.cooker._parse(conf_file, d)
|
||||||
|
return data
|
||||||
|
|
||||||
def parse_layer_conf(layerdir, data, logger=None):
|
def parse_layer_conf(layerdir, data, logger=None):
|
||||||
conf_file = os.path.join(layerdir, "conf", "layer.conf")
|
conf_file = os.path.join(layerdir, "conf", "layer.conf")
|
||||||
|
|
||||||
|
@ -169,12 +178,7 @@ def parse_layer_conf(layerdir, data, logger=None):
|
||||||
return
|
return
|
||||||
|
|
||||||
data.setVar('LAYERDIR', str(layerdir))
|
data.setVar('LAYERDIR', str(layerdir))
|
||||||
if hasattr(bb, "cookerdata"):
|
data = parse_conf(conf_file, data)
|
||||||
# Newer BitBake
|
|
||||||
data = bb.cookerdata.parse_config_file(conf_file, data)
|
|
||||||
else:
|
|
||||||
# Older BitBake (1.18 and below)
|
|
||||||
data = bb.cooker._parse(conf_file, data)
|
|
||||||
data.expandVarref('LAYERDIR')
|
data.expandVarref('LAYERDIR')
|
||||||
|
|
||||||
def runcmd(cmd, destdir=None, printerr=True, logger=None):
|
def runcmd(cmd, destdir=None, printerr=True, logger=None):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user