[OE-core] [PATCH] systemd: fix useradd parameter generation

Christopher Larson clarson at kergoth.com
Mon Aug 8 14:12:25 UTC 2016


On Mon, Aug 8, 2016 at 6:37 AM, Enrico Jorns <ejo at 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 <ejo at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20160808/89473ec7/attachment-0002.html>


More information about the Openembedded-core mailing list