[yocto] Undefining a variable in a recipe?

Paul Eggleton paul.eggleton at linux.intel.com
Fri May 2 06:28:00 PDT 2014


On Friday 02 May 2014 10:23:10 Otavio Salvador wrote:
> On Fri, May 2, 2014 at 10:11 AM, Alex J Lennon
> 
> <ajlennon at dynamicdevices.co.uk> wrote:
> > On 02/05/2014 14:07, Otavio Salvador wrote:
> >> On Fri, May 2, 2014 at 10:01 AM, Alex J Lennon
> >> 
> >> <ajlennon at dynamicdevices.co.uk> wrote:
> >>> On 02/05/2014 13:56, Otavio Salvador wrote:
> >>>> On Fri, May 2, 2014 at 2:24 AM, Alex J Lennon
> >>>> <ajlennon at dynamicdevices.co.uk> wrote:
> >>>> ...
> >>>> 
> >>>>> So I guess I'm at the point where I'm wondering if a getVar() with a
> >>>>> flag is behaving as you would expect it to,
> >>>>> or how I might go about ensuring either UBOOT_MACHINE or UBOOT_CONFIG
> >>>>> isn't defined?
> >>>>> 
> >>>>> Thanks in advance for any advice,
> >>>> 
> >>>> I think we have a simple error error. You are mixing a recipe, which
> >>>> is old and a metadata layer with new concepts.
> >>>> 
> >>>> The u-boot-imx, in 2009.08 recipe, used to set the UBOOT_MACHINE in
> >>>> the recipe as it was left as a fallback in case user needed it and the
> >>>> value was different from newer releases.
> >>>> 
> >>>> In your case, the easier is to make a new yourmachine.conf and use the
> >>>> UBOOT_CONFIG or UBOOT_MACHINE setting there so it will work just fine.
> >>> 
> >>> If I have to do that, then I have to do that.
> >>> 
> >>> However if I could just undefine one of the two variables defined in the
> >>> meta-fsl-arm
> >>> layer then I could continue with what I am doing without having to spend
> >>> the time
> >>> right now to rework the configuration, which is wasted effort for me, as
> >>> I will be moving
> >>> up to the new version of u-boot in the near future.
> >>> 
> >>> Is there no simple way to undefine a variable in a recipe?
> >> 
> >> You can change the recipe byhand. This is ugly and I wouldn't do it. I
> >> do think you are wasting more time trying to 'workaround' it than
> >> fixing it.
> > 
> > Or indeed, would be not be reasonable to modify the uboot-config.bbclass
> > such that
> > it tested for and discarded empty strings in UBOOT_MACHINE / UBOOT_CONFIG
> > which would seem to be a more complete test and would eliminate the
> > problem ?
> 
> Like: http://privatepaste.com/8046479967

"if len(x) > 0", "if len(x)",  and "if x" are all equivalent tests for empty 
strings in Python, so this part of the change does nothing but make the code  
slightly harder to read. This part of the test is not where the problem lies.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the yocto mailing list