Added file header section and put 'includes' under it.
In the current configuration file we mix between entries that are file specific (like includes and later version) and entries that are used by the rest of kas, that are not file specific (machine, target, repos, etc.) It might not be obvious to differenciate between those entries. This patch introduces a header section into the configuration file, to contain every setting that is specific to the file and not the complete kas configuration. The 'includes' statement is moved there, because its file specific. Signed-off-by: Claudius Heine <ch@denx.de>
This commit is contained in:
parent
34dd07e76e
commit
a65a85b373
@ -109,14 +109,15 @@ class GlobalIncludes(IncludeHandler):
|
||||
|
||||
topfile.yml:
|
||||
-------
|
||||
includes:
|
||||
- include1.yml
|
||||
- file: include2.yml
|
||||
- repo: repo1
|
||||
file: include-repo1.yml
|
||||
- repo: repo2
|
||||
file: include-repo2.yml
|
||||
- include3.yml
|
||||
header:
|
||||
includes:
|
||||
- include1.yml
|
||||
- file: include2.yml
|
||||
- repo: repo1
|
||||
file: include-repo1.yml
|
||||
- repo: repo2
|
||||
file: include-repo2.yml
|
||||
- include3.yml
|
||||
-------
|
||||
|
||||
Includes are merged in in this order:
|
||||
@ -132,7 +133,9 @@ class GlobalIncludes(IncludeHandler):
|
||||
if not isinstance(current_config, collections.Mapping):
|
||||
raise IncludeException('Configuration file does not contain a '
|
||||
'dictionary as base type')
|
||||
for include in current_config.get('includes', []):
|
||||
header = current_config.get('header', {})
|
||||
|
||||
for include in header.get('includes', []):
|
||||
if isinstance(include, str):
|
||||
includefile = ''
|
||||
if include.startswith(os.path.pathsep):
|
||||
|
Loading…
Reference in New Issue
Block a user