scripts/combo-layer: a simple way to script the como-layer conf
PATCH 1/1 scripts/combo-layer: a simple way to script the como-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.
--- scripts/combo-layer | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
scripts/combo-layer +3 -0
@@ -91,6 +91,9 @@ last_revision = for repo in self.parser.sections(): self.repos[repo] = {} for (name, value) in self.parser.items(repo): + if value.startswith("@"): + self.repos[repo][name] = eval(value.strip("@")) + else: self.repos[repo][name] = value def update(self, repo, option, value):
Signature · 1 line
1.7.2.5
It looks good to me. You may also want to update the config file description in the "class Configuration". So that user will be aware of the usage.
Regards
Ke
Quoted 41 lines
-----Original Message-----
From: Leandro Dorileo [mailto:[email protected]]
Sent: Wednesday, August 10, 2011 3:44 AM
To: [email protected]
Cc: Yu, Ke; Leandro Dorileo
Subject: [PATCH]scripts/combo-layer: a simple way to script the como-layer confThis 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_repocould be easily configured as:[bitbake]
local_repo= @os.getenv("LOCAL_REPO_DIR") + "/bitbake"or any more sophisticated python syntax.
Signed-off-by Leandro Dorileo <[email protected]>--- scripts/combo-layer | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)scripts/combo-layer index d129175..3dadf4a renamed from scripts/combo-layer +0
-0100755
scripts/combo-layer +3
-1@@ -91,6 +91,9 @@ last_revision = for repo in self.parser.sections(): self.repos[repo] = {} for (name, value) in self.parser.items(repo): + if value.startswith("@"): + self.repos[repo][name] = eval(value.strip("@")) + else: self.repos[repo][name] = value def update(self, repo, option, value): --1.7.2.5
Hi Ke,
Quoted 1 line · Ke
It looks good to me. You may also want to update the config file description in the "class Configuration". So that user will be aware of the usage.
Ok. I've addressed that in a last patch I've sent.
Thanks for reviewing...
Regards...
Leandro Dorileo
Quoted 52 lines
Regards
KeQuoted 38 lines
-----Original Message-----
From: Leandro Dorileo [mailto:[email protected]]
Sent: Wednesday, August 10, 2011 3:44 AM
To: [email protected]
Cc: Yu, Ke; Leandro Dorileo
Subject: [PATCH]scripts/combo-layer: a simple way to script the como-layer confThis 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_repocould be easily configured as:[bitbake]
local_repo= @os.getenv("LOCAL_REPO_DIR") + "/bitbake"or any more sophisticated python syntax.
Signed-off-by Leandro Dorileo <[email protected]>---
scripts/combo-layer | 3 +++1 files changed, 3 insertions(+), 0 deletions(-)scripts/combo-layer index d129175..3dadf4a renamed from scripts/combo-layer +0
-0100755
scripts/combo-layer +0
-0@@ -91,6 +91,9 @@ last_revision =for repo in
self.parser.sections():
self.repos[repo] = {}
for (name, value) inself.parser.items(repo):
+ ifvalue.startswith("@"):
+ self.repos[repo][name] = eval(value.strip("@"))
+ else:
self.repos[repo][name] = valueQuoted 3 lines
def
update(self, repo, option, value):
--
1.7.2.5_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core