[OE-core] [PATCH 1/1] useradd-staticids.bbclass: Do not require trailing colons

Burton, Ross ross.burton at intel.com
Fri Oct 23 15:20:14 UTC 2015


On 23 October 2015 at 11:38, Peter Kjellerstedt <peter.kjellerstedt at axis.com
> wrote:

> -                        field = line.rstrip().split(":")
> +                        # Make sure there always are at least seven
> elements in
> +                        # the field list. This allows for leaving out
> trailing
> +                        # colons in the passwd file.
> +                        line = line.rstrip() + "::::::"
> +                        field = line.split(":")
>

It's a stylist thing but I prefer padding the field list instead of
manipulating the input string. Something like

  field = line.strip().split(":")
  field += [''] * (7 - len(field))

Ross
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20151023/172e9d67/attachment-0002.html>


More information about the Openembedded-core mailing list