mirror of
https://git.yoctoproject.org/poky
synced 2026-09-13 18:49:33 +02:00
scripts/combo-layer: a simple way to script the combo-layer conf
This small patch introduces a a very simple and basic way to script
the combo-layer conf file. With that a combo can be shared with no
need to change its config - associated to the use of environment
variables for example.
*Similar* to bitbake it considers every value starting with @ to be
a python script. So local_repo could be easily configured as:
[bitbake]
local_repo = @os.getenv("LOCAL_REPO_DIR") + "/bitbake"
or any more sophisticated python syntax.
This version updates the config file description so users can be
aware of.
(From OE-Core rev: 62269642ce0e0e56d68d495b6c4d27327c9ed649)
Signed-off-by: Leandro Dorileo <ldorileo@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
6ede105953
commit
6cfe8c0a14
@@ -79,6 +79,14 @@ local_repo_dir = ~/src/oecore
|
|||||||
dest_dir = .
|
dest_dir = .
|
||||||
last_revision =
|
last_revision =
|
||||||
|
|
||||||
|
# it's also possible to embed python code in the config values. Similar
|
||||||
|
# to bitbake it considers every value starting with @ to be a python script.
|
||||||
|
# So local_repo could be easily configured using an environment variable as:
|
||||||
|
#
|
||||||
|
# [bitbake]
|
||||||
|
# local_repo = @os.getenv("LOCAL_REPO_DIR") + "/bitbake"
|
||||||
|
#
|
||||||
|
|
||||||
# more components ...
|
# more components ...
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@@ -91,7 +99,10 @@ last_revision =
|
|||||||
for repo in self.parser.sections():
|
for repo in self.parser.sections():
|
||||||
self.repos[repo] = {}
|
self.repos[repo] = {}
|
||||||
for (name, value) in self.parser.items(repo):
|
for (name, value) in self.parser.items(repo):
|
||||||
self.repos[repo][name] = value
|
if value.startswith("@"):
|
||||||
|
self.repos[repo][name] = eval(value.strip("@"))
|
||||||
|
else:
|
||||||
|
self.repos[repo][name] = value
|
||||||
|
|
||||||
def update(self, repo, option, value):
|
def update(self, repo, option, value):
|
||||||
self.parser.set(repo, option, value)
|
self.parser.set(repo, option, value)
|
||||||
|
|||||||
Reference in New Issue
Block a user