[OE-core] [PATCH] uboot-config: check UBOOT_CONFIG variable, not flags, for error conditions

Denys Dmytriyenko denis at denix.org
Fri Jun 9 22:52:26 UTC 2017


On Fri, Jun 09, 2017 at 03:42:28PM -0700, Christopher Larson wrote:
> On Fri, Jun 9, 2017 at 11:41 AM, Denys Dmytriyenko <denis at denix.org> wrote:
> 
> > +    ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split()
> >
> > -    if not ubootmachine and not ubootconfigflags:
> > +    if not ubootmachine and len(ubootconfig) == 0:
> >
> 
> There’s no need for len() here, just `if not ubootmachine and not
> ubootconfig:` should do, since a string is falsy when it’s empty.

Thanks, Chris,

I was just using the same syntax that was already there:

-    ubootconfig = (d.getVar('UBOOT_CONFIG') or "").split()
     if len(ubootconfig) > 0:
-    elif len(ubootconfig) == 0:
-       raise bb.parse.SkipPackage('You must set a default in UBOOT_CONFIG.')

I can submit v2, if it would make more sense.

-- 
Denys



More information about the Openembedded-core mailing list