Openembedded Bitbake Development
 help / color / mirror / Atom feed
From: Gary Thomas <gary@mlbassoc.com>
To: bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH] bitbake: Allow ~ in bblayers
Date: Fri, 17 Apr 2015 05:18:21 -0600	[thread overview]
Message-ID: <5530EBFD.4090406@mlbassoc.com> (raw)
In-Reply-To: <1429267317.6976.196.camel@linuxfoundation.org>

On 2015-04-17 04:41, Richard Purdie wrote:
> On Thu, 2015-04-16 at 21:28 +0300, Ed Bartosh wrote:
>> Implemented processing of ~ in bblayer's paths if HOME
>> environment variable is approved.
>>
>> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
>> ---
>>   bitbake/lib/bb/cookerdata.py | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
>> index 6c11a60..bf08c63 100644
>> --- a/bitbake/lib/bb/cookerdata.py
>> +++ b/bitbake/lib/bb/cookerdata.py
>> @@ -269,8 +269,11 @@ class CookerDataBuilder(object):
>>               layers = (data.getVar('BBLAYERS', True) or "").split()
>>
>>               data = bb.data.createCopy(data)
>> +            approved = bb.utils.approved_variables()
>>               for layer in layers:
>>                   parselog.debug(2, "Adding layer %s", layer)
>> +                if 'HOME' in approved:
>
> can we change this to
>
> if 'HOME' in approved and '~' in layer:
>
> simply so that we can more easily remember what this code is doing in
> the future?

+1

This change also has the side effect of not causing an expansion of
all layers if HOME is in the approved list which would seem a useful
optimization.

>
> Cheers,
>
> Richard
>
>> +                    layer = os.path.expanduser(layer)
>>                   data.setVar('LAYERDIR', layer)
>>                   data = parse_config_file(os.path.join(layer, "conf", "layer.conf"), data)
>>                   data.expandVarref('LAYERDIR')
>> --
>> 2.1.4
>>
>
>

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


  reply	other threads:[~2015-04-17 11:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-14 20:45 [PATCH] Allow environment variables and ~ in bbconf paths Ed Bartosh
2015-04-14 21:19 ` Rifenbark, Scott M
2015-04-14 21:33   ` Christopher Larson
2015-04-15 11:48     ` Ed Bartosh
2015-04-15 14:43     ` [PATCH] bitbake: Allow environment variables and ~ in bblayers Ed Bartosh
2015-04-15 19:38       ` Christopher Larson
2015-04-16 18:28         ` [PATCH] bitbake: Allow " Ed Bartosh
2015-04-17 10:41           ` Richard Purdie
2015-04-17 11:18             ` Gary Thomas [this message]
2015-04-18 15:09             ` Ed Bartosh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5530EBFD.4090406@mlbassoc.com \
    --to=gary@mlbassoc.com \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox