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

Mike Frysinger vapier at gentoo.org
Tue Jul 19 23:38:48 CEST 2011


On Tue, Jul 19, 2011 at 17:28, Jeroen Hofstee wrote:
>> maybe i havent read enough sed scripts, but i dont think ive seen "!"
>
> I took this for irony, so I triple checked:

i didnt mean "it isnt in POSIX" (because it is), i meant it as "no one
uses it, so it wont be obvious to people reading this code later as to
what's going on"

>> used before.  how about this more straightforward replacement:
>> sed -e '/=/{s/=/\t/;q}' -e 's/$/\t1/'
>
> 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).

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


More information about the U-Boot mailing list