[PATCH v8 4/8] env: Allow U-Boot scripts to be placed in a .env file

Simon Glass sjg at chromium.org
Tue Oct 19 18:24:25 CEST 2021


Hi Wolfgang,

On Tue, 19 Oct 2021 at 10:20, Wolfgang Denk <wd at denx.de> wrote:
>
> Dear Simon,
>
> In message <CAPnjgZ1p6ueRhDsgBZGMXFhgv7UhRFA1UfvoHGGd0-136oTgvA at mail.gmail.com> you wrote:
> >
> > But how do we handle this?
> >
> > var+=fred
> >
> > Is this appending to var or assigning to var+  ?
>
> It is assigning to "var+".

er...

> >
> > var++=fred
> >
> > is unambiguous but very confusing. I think it would be better to disallow +
>
> It's neither unambiguous nor confusing.  It is assigning to "var++".

What? Can you read that again?

>
>
> I think we should not change what is old and might be in use.
>
> It is much easier to change what is new and can be defined at will.
>
> If we define for example that "<name>=+<value>" appends, then we can
> also define our own escape rules, for example:
>
>         var=fred        assigns
>         var=+fred       appends "fred"
>         var=\+fred      assignes the value "+fred"
>         var=++fred      appends "+fred"

I don't like that at all. It requires an escape for a common case and
is very confusing.

Since people will be converting their out-of-tree scripts anyway, they
can check for this sort of madness at the time. There should be no
problem.

Regards,
Simon


More information about the U-Boot mailing list