scripts/combo-layer: a simple way to script the como-layer conf

Submitted by Leandro Dorileo on Aug. 9, 2011, 7:44 p.m.

Details

Message ID 1312919065-7554-1-git-send-email-ldorileo@gmail.com
State New, archived
Headers show

Commit Message

Leandro Dorileo Aug. 9, 2011, 7:44 p.m.
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.

Signed-off-by: Leandro Dorileo <ldorileo@gmail.com>
---
 scripts/combo-layer |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

diff --git a/scripts/combo-layer b/scripts/combo-layer
index d129175..3dadf4a 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -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):

Comments

Yu Ke Aug. 10, 2011, 3:01 a.m.
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

> -----Original Message-----
> From: Leandro Dorileo [mailto:ldorileo@gmail.com]
> Sent: Wednesday, August 10, 2011 3:44 AM
> To: openembedded-core@lists.openembedded.org
> Cc: Yu, Ke; Leandro Dorileo
> Subject: [PATCH] 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.
> 
> Signed-off-by: Leandro Dorileo <ldorileo@gmail.com>
> ---
>  scripts/combo-layer |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/scripts/combo-layer b/scripts/combo-layer index d129175..3dadf4a
> 100755
> --- a/scripts/combo-layer
> +++ b/scripts/combo-layer
> @@ -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
Leandro Dorileo Aug. 10, 2011, 5:25 a.m.
Hi Ke,

On Tue, Aug 9, 2011 at 11:01 PM, Yu, Ke <ke.yu@intel.com> wrote:
> 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

>
> Regards
> Ke
>
>> -----Original Message-----
>> From: Leandro Dorileo [mailto:ldorileo@gmail.com]
>> Sent: Wednesday, August 10, 2011 3:44 AM
>> To: openembedded-core@lists.openembedded.org
>> Cc: Yu, Ke; Leandro Dorileo
>> Subject: [PATCH] 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.
>>
>> Signed-off-by: Leandro Dorileo <ldorileo@gmail.com>
>> ---
>>  scripts/combo-layer |    3 +++
>>  1 files changed, 3 insertions(+), 0 deletions(-)
>>
>> diff --git a/scripts/combo-layer b/scripts/combo-layer index d129175..3dadf4a
>> 100755
>> --- a/scripts/combo-layer
>> +++ b/scripts/combo-layer
>> @@ -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
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>