On Mon, Aug 8, 2016 at 6:37 AM, Enrico Jorns <e...@pengutronix.de> wrote:

> Constructing the USERADD_PARAM_${PN} value with += (as done before)
> resulted in having a whitespace added for each entry not having its
> PACKAGECONFIG parameter activated.
>
> This is not only a cosmetical issue. The useradd class concatenates all
> useradd commands from all subpackages of a package by doing a
> ";".join(). When having a useradd command that ends with ";" and some
> extra spaces, concatenation will result in an empty useradd argument
> ("commandA;    ;commandB"). The useradd command will be called with this
> and make the Yocto build break by returning an error code.
>
> Fortunately, there is no problem when having a "commandA;;commandB" in
> the useradd string, this will be ignored. Thus using "_append" instead of
> "+=" is sufficient here.
>
> Signed-off-by: Enrico Jorns <e...@pengutronix.de>
>

Use .=, not _append. _append is a postponed operation, .= is immediate like
+= is.

Also, why not make useradd.bbclass sanitize the input / ignore empty
entries?
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to