[Bug 3091] Nonportable tool usage in scripts

Rich Felker dalias at aerifal.cx
Thu Apr 7 15:14:04 UTC 2011


On Wed, Apr 06, 2011 at 08:33:13PM +0100, Chris Rees wrote:
> On 5 April 2011 16:43, Rich Felker <dalias at aerifal.cx> wrote:
> > On Thu, Feb 10, 2011 at 09:33:32AM +0100, Denys Vlasenko wrote:
> >> > While BusyBox supports it, the -r option to sed is nonstandard, so
> >> > little is improved. If you want to go this route, use:
> >> >
> >> > sed -ne 's/\(^#\{0,1\} \{0,1\}CONFIG_.*\)$/"\1\\n"/gp' "$config"
> >> >
> >> > But really I don't care which solution is applied; I'd just like to
> >> > see _something_ correct done so I don't have to keep patching around
> >> > the issue.
> >>
> >> Current git should be fixed already. Ping me if it isn't.
> >
> > It's not fixed in 1.18.4, which was released much later...
> >
> > Rich
> >
> 
> That's because there are two instances of it in that file.
> 
> Patch at [1] makes it work fine for FreeBSD grep... it looks less
> specific but it should have the same effect.
> 
> Just putting a * in instead of \? makes it less likely to break, and
> the only possible side effect is that:
> 
> # # CONFIG_SOMETHING
> 
> could match by accident-- how likely is that??

There's been way too much discussion about which fix is ideal and way
too little fixing it. :-) I'm fine with anything that works. We have
someone working on a self-bootstrapping/self-hosting mini distro based
on musl and busybox, and he's been having to patch busybox to get it
to build right due to this issue (and several others which I thought
were fixed but somehow haven't been - I'll report them soon).

Rich


More information about the busybox mailing list