[U-Boot] [PATCH 2/3] mkconfig: create CONFIG_ defines without relying on GNU extensions

Jeroen Hofstee
2011-07-19T22:05:26Z

Hi Mike,
>> Won't work on FreeBSD since it can't quite early [afaik] (perhaps with a
>> label, but gets rather ugly..)
>>
>> [jeroen at blue ~]$ echo configflag | sed -e '/=/{s/=/\t/;q}' -e 's/$/\t1/'
>> sed: 1: "/=/{s/=/\t/;q}
>> ": extra characters at the end of q command
> i'm not sure you've diagnosed the problem correctly. the fact that
> the output says "end of q command" indicates that FreeBSD does support
> the "q" command (as required by POSIX).
>
I didn't apparently..
> perhaps the problem is that the ";" extension to separating commands
> (which is not in POSIX afaics) does not work the same in FreeBSD's sed
> as GNU's sed. i imagine if you stick a ";" after the "q" command
> it'll work ...
>
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html
> -mike
Yes, the ; does work as expected, thanks!

[jeroen at blue ~]$ echo config | sed -e '/=/{s/=/ /;q;}' -e 's/$/ 1/'
config 1
[jeroen at blue ~]$ echo config=2 | sed -e '/=/{s/=/ /;q;}' -e 's/$/ 1/'
config 2

Shall change the patch accordingly tomorrow.

Regards,
Jeroen