Project

General

Profile

Submit #2966

freebsd 11 grep version 2.5.1

Added by htse 9 months ago. Updated 9 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Userland
Target version:
Start date:
11/09/2016
Due date:
% Done:

0%


Description

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/

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

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

* 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

* 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 *
/usr/bin:
[always]
grep fgrep egrep zgrep zegrep zfgrep

[MK_LZMA_SUPPORT]
lzegrep lzgrep xzegrep xzgrep lzfgrep xzfgrep

[MK_BZIP2_SUPPORT]
bzegrep bzgrep bzfgrep

(which are all symlinks to grep binary)

* INSTALLED MANPAGES *
/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

* 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.

freebsd_grep.patch View (136 KB) htse, 11/09/2016 12:01 PM

History

#1 Updated by dragonflybsd1 9 months ago

I'm sorry you wasted your time because of an extremely old wiki page.

There's a reason we use GNU grep over the BSD grep: It performs much, much better. There's no intention to bring in BSD grep. You can get it from dports if you really want it. we're going to stick with the last GNU grep and keep updating it.

Also available in: Atom PDF