[OE-core] [PATCH] oeqa/utils: Allow ~ in bblayers
Mario Domenech Goulart
mario at ossystems.com.br
Thu Apr 30 13:30:30 UTC 2015
On Thu, 30 Apr 2015 07:16:28 -0600 Gary Thomas <gary at mlbassoc.com> wrote:
> On 2015-04-30 07:08, Mario Domenech Goulart wrote:
>>
>> On Thu, 30 Apr 2015 14:04:50 +0300 Ed Bartosh <ed.bartosh at linux.intel.com> wrote:
>>
>>> Bitbake can parse ~ in bblayer's paths.
>>> Added this functionality to oeqa code.
>>>
>>> Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
>>> ---
>>> meta/lib/oeqa/utils/commands.py | 2 ++
>>> 1 file changed, 2 insertions(+)
>>>
>>> diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
>>> index e8a467f..bc1dbb1 100644
>>> --- a/meta/lib/oeqa/utils/commands.py
>>> +++ b/meta/lib/oeqa/utils/commands.py
>>> @@ -155,6 +155,8 @@ def get_test_layer():
>>> layers = get_bb_var("BBLAYERS").split()
>>> testlayer = None
>>> for l in layers:
>>> + if '~' in l:
>>> + l = os.path.expanduser(l)
>>
>> Is the "if '~' in l" test necessary?
>>
>> AFAIK, applying expanduser to a string that doesn't contain '~' will
>> just return the string itself.
>
> True, but why expand (create a new string, have to garbage-collect
> the old one, etc) when it's not necessary?
Good point, Gary. Maybe we should only care about '~' as the first
character in paths? In this case, "if l.startswith('~')" would do the
trick.
Best wishes.
Mario
--
http://www.ossystems.com.br
More information about the Openembedded-core
mailing list