Project

General

Profile

Submit #2966

Updated by tuxillo over 2 years ago

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

Back