config: Write out config headers in sections

Make the header sections in local.conf and bblayers.conf easier
identifiable by naming them and writing them in chunks, separated by
blank lines. This can help with debugging the resulting configuration.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Jan Kiszka 2017-07-03 11:34:31 +02:00 committed by Daniel Wagner
parent 7248d5e1bb
commit 9f4af22ac6

View File

@ -150,17 +150,26 @@ class Config:
self._config.get('target',
'core-image-minimal'))
def _get_conf_header(self, header_name):
"""
Returns the local.conf header
"""
header = ''
for key, value in self._config.get(header_name, {}).items():
header += '# {}\n{}\n'.format(key, value)
return header
def get_bblayers_conf_header(self):
"""
Returns the bblayers.conf header
"""
return '\n'.join(self._config.get('bblayers_conf_header', {}).values())
return self._get_conf_header('bblayers_conf_header')
def get_local_conf_header(self):
"""
Returns the local.conf header
"""
return '\n'.join(self._config.get('local_conf_header', {}).values())
return self._get_conf_header('local_conf_header')
def get_machine(self):
"""