Re: BSD grep fixes
Em 2010.07.28. 17:48, Dag-Erling Smørgrav escreveu: Gabor Kovesdan writes: b. f. writes: I don't think that the current behavior of bsdgrep is necessarily bad -- in fact it seems to me to be simple and intuitive: nothing is excluded or included implicitly, and (I think) the last match wins, unlike in gnu grep. Ok, thanks, then I'll just document it. Uh, no. GNU grep's behavior is consistent with just about everything else that has --include / --exclude options, e.g. tar and rsync. Please change BSD grep's behavior to match GNU grep's. Ok, thanks for mentioning this. I already have a patch to implement the same behaviour, I'll discuss it with my mentor and fix soon. Gabor ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: BSD grep fixes
Gabor Kovesdan writes: > b. f. writes: > > I don't think that the current behavior of bsdgrep is necessarily bad > > -- in fact it seems to me to be simple and intuitive: nothing is > > excluded or included implicitly, and (I think) the last match wins, > > unlike in gnu grep. > Ok, thanks, then I'll just document it. Uh, no. GNU grep's behavior is consistent with just about everything else that has --include / --exclude options, e.g. tar and rsync. Please change BSD grep's behavior to match GNU grep's. DES -- Dag-Erling Smørgrav - d...@des.no ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: BSD grep fixes
Em 2010.07.28. 17:26, b. f. escreveu: I don't think that the current behavior of bsdgrep is necessarily bad -- in fact it seems to me to be simple and intuitive: nothing is excluded or included implicitly, and (I think) the last match wins, unlike in gnu grep. I mention it only because it is different, and you may want to consider how closely you want it to mimic the behavior of gnu grep for the sake of compatibility. If bsdgrep already passed a ports exp-run, and build/installworld now work without any problems, then it may be simpler to just retain the current behavior. Either way, though, the effect of overlapping --(in|ex)clude(-dir) options should be explicitly mentioned in the manpage. Thank you, by the way, for your efforts to provide us with good BSD-licensed tools. I hope that you can find the time and energy to continue with the iconv, regex, and other text-processing tool improvements. Ok, thanks, then I'll just document it. Actually, I also think this behaviour is more intuitive, that's why I implemented it in this way. As for iconv, it needs a portbuild run and in first phase ports will still use GNU libiconv but BSD iconv will make its way into base if it passes the exp-run. Gabor ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: BSD grep fixes
On 7/28/10, Gabor Kovesdan wrote: > Em 2010.07.27. 5:59, b. f. escreveu: > Thanks for bringing this up, I'll take a look and try to implement the > same behaviour. And I will also document the behaviour. I don't think that the current behavior of bsdgrep is necessarily bad -- in fact it seems to me to be simple and intuitive: nothing is excluded or included implicitly, and (I think) the last match wins, unlike in gnu grep. I mention it only because it is different, and you may want to consider how closely you want it to mimic the behavior of gnu grep for the sake of compatibility. If bsdgrep already passed a ports exp-run, and build/installworld now work without any problems, then it may be simpler to just retain the current behavior. Either way, though, the effect of overlapping --(in|ex)clude(-dir) options should be explicitly mentioned in the manpage. Thank you, by the way, for your efforts to provide us with good BSD-licensed tools. I hope that you can find the time and energy to continue with the iconv, regex, and other text-processing tool improvements. b. ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: BSD grep fixes
Em 2010.07.27. 5:59, b. f. escreveu: Other important differences between bsdgrep and GNU grep: The --include option in bsdgrep does not have the same effect as the corresponding option in GNU grep -- in GNU grep, that option causes _only_ those files matching the file inclusion pattern to be searched. To obtain the same behavior in bsdgrep, one must issue something like --exclude '*' --include pattern. The effect of multiple overlapping --include and --exclude options is different in the two greps. It would be wise to add comments about precedence of such options in the bsdgrep manpage, as is done, for example, in bsdtar(1). Thanks for bringing this up, I'll take a look and try to implement the same behaviour. And I will also document the behaviour. Gabor ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: BSD grep fixes
Other important differences between bsdgrep and GNU grep: The --include option in bsdgrep does not have the same effect as the corresponding option in GNU grep -- in GNU grep, that option causes _only_ those files matching the file inclusion pattern to be searched. To obtain the same behavior in bsdgrep, one must issue something like --exclude '*' --include pattern. The effect of multiple overlapping --include and --exclude options is different in the two greps. It would be wise to add comments about precedence of such options in the bsdgrep manpage, as is done, for example, in bsdtar(1). b. ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: BSD grep fixes
`-l' option is not supposed to show the matching line at all, only filename. Thanks. Fix is ready and waiting for my mentor's approval. http://kovesdan.org/patches/grep-lL.diff Gabor ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: BSD grep fixes
(the message didn't get into the list because of silly typo: `cuirrent@' instead of `current@') Gabor Kovesdan writes: > I've fixed the last two issues that were reported. If you encounter > something more, please let me know. Thanks. But I think there is another issue affecting usr.bin/kdump/mkioctls. $ make depend sh /usr/src/usr.bin/kdump/mkioctls /usr/include > ioctl.c :1:31: fatal error: altq/altq.h:#define: No such file or directory compilation terminated. sh /usr/src/usr.bin/kdump/mksubr /usr/include > kdump_subr.c rm -f .depend mkdep -f .depend -a-I/usr/src/usr.bin/kdump/../ktrace -I/usr/src/usr.bin/kdump -I/usr/src/usr.bin/kdump/../.. /usr/src/usr.bin/kdump/kdump.c ioctl.c kdump_subr.c /usr/src/usr.bin/kdump/../ktrace/subr.c ioctl.c:26:31: fatal error: altq/altq.h:#define: No such file or directory compilation terminated. mkdep: compile failed *** Error code 1 Stop in /usr/src/usr.bin/kdump. If I reduce to a simple case it would look like following $ echo blah >foo $ echo clop >bar $ bsd-grep -l '.*' ./* ./foo:blah ./foo ./bar:clop ./bar $ gnu-grep -l '.*' ./* ./foo ./bar `-l' option is not supposed to show the matching line at all, only filename. > > Gabor > > Mensagem Original > Assunto: svn commit: r210461 - head/usr.bin/grep >Data: Sun, 25 Jul 2010 08:42:18 + (UTC) > De: Gabor Kovesdan >Para: src-committ...@freebsd.org, svn-src-...@freebsd.org, > svn-src-h...@freebsd.org > > Author: gabor > Date: Sun Jul 25 08:42:18 2010 > New Revision: 210461 > URL: http://svn.freebsd.org/changeset/base/210461 > > Log: > - Fix --color behaviour to only output color sequences if stdout is a tty > or if forced mode is specified [1] > - While here, add some alternative names for the options and make then > case-insensitive > - Fix -q and -l behaviour [2] > - Some small changes to make the code easier to review > > Submitted by: swel...@gmail.com [1], > dougb [2] > Approved by:delphij (mentor) ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"