[bitbake-devel] [PATCH] bitbake: Allow ~ in bblayers

Gary Thomas gary at mlbassoc.com
Fri Apr 17 11:18:21 UTC 2015


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 at 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
------------------------------------------------------------



More information about the bitbake-devel mailing list