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

Simon Glass sjg at chromium.org
Tue Oct 19 16:11:37 CEST 2021


Hi Wolfgang,

On Tue, 19 Oct 2021 at 04:46, Wolfgang Denk <wd at denx.de> wrote:
>
> Dear Simon,
>
> In message <CAPnjgZ15KavTBZoML7dv_EaRJMyJvbA=kmY3Bgz4AeygwEppuQ at mail.gmail.com> you wrote:
> >
> > Can we just ban + ?
>
> Why?  Just because your awk script is a lousy parser?
>
> > In the above, foo\+ gives an unknown escape sequence from the C
> > preprocessor, then the whole line is ignored by the script
>
> Really?
>
> -> cat foo.c
> #define A ampersand
> #define B berta
>
> int foo = A \+ B ;
> -> gcc -E foo.c
> # 0 "foo.c"
> # 0 "<built-in>"
> # 0 "<command-line>"
> # 1 "/usr/include/stdc-predef.h" 1 3 4
> # 0 "<command-line>" 2
> # 1 "foo.c"
>
>
>
> int foo = ampersand \+ berta ;
>
> I do not see any such error message?

I thought you were trying to use + at the end of a variable.

I used:

fred\+=aaa

and got

cc1: warning: unknown escape sequence: '\=''

You can try it yourself by editing sandbox.env in the
u-boot-dm/env-working tree.

>
>
> > foo+ = bar   produes a variable called "foo+ " in the environment with
> > the value " bar" so you probably don't want that.
>
> This is only because your "parser" is very primitive and sensitive
> even to minimal white space changes.

Agreed.

>
> > My original motivation was the complexity of getting the env you want
> > using #define
> >
> > My current motivation is to complete the CONFIG migration, now in its 8th year.
>
> I fully understand your motivation and appreciate your efforts.

OK, so what exactly is needed here? I can do the above tweaks and the
cover letter, but what else?

Regards,
Simon


More information about the U-Boot mailing list