summaryrefslogtreecommitdiffstats
path: root/scripts/combo-layer
diff options
context:
space:
mode:
authorLeandro Dorileo <ldorileo@gmail.com>2011-08-10 01:09:05 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-11 19:22:05 +0100
commit6cfe8c0a147aa235c7d6a2cb87b29a3a975f2eac (patch)
treea4f0b75eda16bd93d6534296162c9a4482c4d675 /scripts/combo-layer
parent6ede10595349dcba0cac6f421f5af90403420f0e (diff)
downloadpoky-6cfe8c0a147aa235c7d6a2cb87b29a3a975f2eac.tar.gz
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>
Diffstat (limited to 'scripts/combo-layer')
-rwxr-xr-xscripts/combo-layer13
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer
index d1291751fa..07b3382f0a 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -79,6 +79,14 @@ local_repo_dir = ~/src/oecore
79dest_dir = . 79dest_dir = .
80last_revision = 80last_revision =
81 81
82# it's also possible to embed python code in the config values. Similar
83# to bitbake it considers every value starting with @ to be a python script.
84# So local_repo could be easily configured using an environment variable as:
85#
86# [bitbake]
87# local_repo = @os.getenv("LOCAL_REPO_DIR") + "/bitbake"
88#
89
82# more components ... 90# more components ...
83 91
84 """ 92 """
@@ -91,7 +99,10 @@ last_revision =
91 for repo in self.parser.sections(): 99 for repo in self.parser.sections():
92 self.repos[repo] = {} 100 self.repos[repo] = {}
93 for (name, value) in self.parser.items(repo): 101 for (name, value) in self.parser.items(repo):
94 self.repos[repo][name] = value 102 if value.startswith("@"):
103 self.repos[repo][name] = eval(value.strip("@"))
104 else:
105 self.repos[repo][name] = value
95 106
96 def update(self, repo, option, value): 107 def update(self, repo, option, value):
97 self.parser.set(repo, option, value) 108 self.parser.set(repo, option, value)