On Sun, 2010-04-25 at 21:09 +0200, Denys Vlasenko wrote:
> On Sunday 25 April 2010 20:49, Christopher Barry wrote:
> > On Sun, 2010-04-25 at 18:42 +0200, Denys Vlasenko wrote:
> > > On Friday 23 April 2010 21:15, Christopher Barry wrote:
> > > > Hi everyone.
> > > >
> > > > I've upgraded to v1.16.1, and grep appears to no longer have the '-w'
> > > > option. I have every option in the menuconfig checked in the 'finding
> > > > utilities' section, not sure what I'm doing wrong. Below are the outputs
> > > > of grep --help in both versions.
> > > >
> > > > Anyone have any ideas about what I may not be configuring correctly?
> > >
> > > You (perhaps accidentally) switched off DESKTOP option.
> > >
> >
> > DESKTOP option adds extra functionality to grep?? Wow. Is that really on
> > purpose? I'm not building BB for a desktop scenario, so I definitely
> > switched that off - in fact I never even looked in there, as I just
> > assumed, as it's name certainly implies, that it was a bunch of extra,
> > unneeded, desktopy fluff.
>
> What is needed and what is not needed will vary depending on user.
>
> > Curious, why are additional grep parameters hidden in a completely
> > unrelated option group? Seems like 'Finding Utilities' was already
> > available (and indeed has the other grep options), and would be the
> > logical location for that kind of thing. Is having grep isolate on word
> > boundaries, a core functionality of grep I would argue, related to a
> > DESKTOP in some way that I'm simply not grokking?
>
> Easy: just send a patch which make it possible to select this option
> with dedicated CONFIG_FEATURE_GREP_FOO.
>
Patch attached.
--- ./busybox-1.16.1/findutils/grep.c 2010-03-28 13:43:35.000000000 -0400
+++ ../busybox-1.16.1/findutils/grep.c 2010-04-26 00:30:24.000000000 -0400
@@ -24,10 +24,9 @@
/* options */
#define OPTSTR_GREP \
- "lnqvscFiHhe:f:Lorm:" \
+ "lnqvscFiHhe:f:Lorm:w" \
IF_FEATURE_GREP_CONTEXT("A:B:C:") \
IF_FEATURE_GREP_EGREP_ALIAS("E") \
- IF_DESKTOP("w") \
IF_EXTRA_COMPAT("z") \
"aI"
@@ -51,11 +50,11 @@ enum {
OPTBIT_o, /* show only matching parts of lines */
OPTBIT_r, /* recurse dirs */
OPTBIT_m, /* -m MAX_MATCHES */
+ OPTBIT_w, /* -w whole word match */
IF_FEATURE_GREP_CONTEXT( OPTBIT_A ,) /* -A NUM: after-match context */
IF_FEATURE_GREP_CONTEXT( OPTBIT_B ,) /* -B NUM: before-match context */
IF_FEATURE_GREP_CONTEXT( OPTBIT_C ,) /* -C NUM: -A and -B combined */
IF_FEATURE_GREP_EGREP_ALIAS(OPTBIT_E ,) /* extended regexp */
- IF_DESKTOP( OPTBIT_w ,) /* whole word match */
IF_EXTRA_COMPAT( OPTBIT_z ,) /* input is NUL terminated */
OPT_l = 1 << OPTBIT_l,
OPT_n = 1 << OPTBIT_n,
@@ -73,11 +72,11 @@ enum {
OPT_o = 1 << OPTBIT_o,
OPT_r = 1 << OPTBIT_r,
OPT_m = 1 << OPTBIT_m,
+ OPT_w = 1 << OPTBIT_w,
OPT_A = IF_FEATURE_GREP_CONTEXT( (1 << OPTBIT_A)) + 0,
OPT_B = IF_FEATURE_GREP_CONTEXT( (1 << OPTBIT_B)) + 0,
OPT_C = IF_FEATURE_GREP_CONTEXT( (1 << OPTBIT_C)) + 0,
OPT_E = IF_FEATURE_GREP_EGREP_ALIAS((1 << OPTBIT_E)) + 0,
- OPT_w = IF_DESKTOP( (1 << OPTBIT_w)) + 0,
OPT_z = IF_EXTRA_COMPAT( (1 << OPTBIT_z)) + 0,
};
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox