[DragonFlyBSD - Submit #2966] (Closed) freebsd 11 grep version 2.5.1

bugtracker-admin at leaf.dragonflybsd.org bugtracker-admin at leaf.dragonflybsd.org
Sat Aug 21 07:13:37 PDT 2021


Issue #2966 has been updated by tuxillo.

Status changed from New to Closed
Assignee set to tuxillo

We're open to see a full comparison between gnu grep and bsd grep, feature-wise and performance-wise. After that we might consider moving to bsdgrep but for the moment we will stick with gnu grep.

----------------------------------------
Submit #2966: freebsd 11 grep version 2.5.1
http://bugs.dragonflybsd.org/issues/2966#change-14163

* Author: htse
* Status: Closed
* Priority: Normal
* Assignee: tuxillo
* Category: Userland
* Target version: 6.2
* Start date: 2016-11-09
----------------------------------------
What? FreeBSD 11 grep executable from their userland, BSD license. ( FreeBSD: stable/11/usr.bin/grep/grep.c 280307 2015-03-21 00:21:30Z pfg )
why? because I saw it on this page as TODO: https://www.dragonflybsd.org/docs/developer/ProjectsPage/



<pre>
* MAKEFILE *
Makefile has options to disable LZMA and bzip2 support (default = yes)
grep/Makefile:
MK_LZMA_SUPPORT =  "yes"/"no"
MK_BZIP2_SUPPORT = "yes"/"no"
</pre>

NLS contingent on NLS being defined otherwise CFLAGS+= -DWITHOUT_NLS



<pre>
* MISSING OPTION *
MK_GNU_GREP_COMPAT not done/verified right now since I didn't knew if it made sense to keep if/when you can still have gnu grep as well :/ (kindly advise)
grep/Makefile:
# .if ${MK_GNU_GREP_COMPAT} != "no"
#CFLAGS+= -I${DESTDIR}/usr/include/gnu
#LIBADD+=       gnuregex
# .endif
</pre>



* CHANGE TO ORIGINAL FUNCTIONALITY *
@grep/util.c:146@
I silenced a recursive warning message because it prints "warning: %s: recursive directory loop" to regular output, not stderr (rendering 2>/dev/null 
useless), if it would be better I'll check the warnx outputting function to see if I can redirect it to stderr. GNU grep does not print anything here either, I checked the source.

I haven't removed anything that compiled contrib gnu grep afaik, that might need to be checked



* INSTALLED EXECUTABLES *
<pre>
/usr/bin:
[always]
grep fgrep egrep zgrep zegrep zfgrep

[MK_LZMA_SUPPORT]
lzegrep lzgrep  xzegrep xzgrep lzfgrep xzfgrep

[MK_BZIP2_SUPPORT]
bzegrep bzgrep bzfgrep
</pre>

(which are all symlinks to grep binary) 



* INSTALLED MANPAGES *
<pre>
/usr/share/man/man1:
egrep.1.gz zfgrep.1.gz bzegrep.1.gz lzgrep.1.gz xzfgrep.1.gz zgrep.1.gz lzfgrep.1.gz
xzgrep.1.gz fgrep.1.gz zegrep.1.gz bzgrep.1.gz xzegrep.1.gz bzfgrep.1.gz
pgrep.1.gz lzegrep.1.gz grep.1.gz
</pre>


* TESTING *
This grep was used by me through a few reboot and multiple make clean/buildkernel/buildworld as well as random personal usage. No errors were detected, nothing broke. 


As always, I welcome all critiques and comments so I can learn and grow.

---Files--------------------------------
freebsd_grep.patch (136 KB)


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account


More information about the Submit mailing list