Project

General

Profile

Actions

Submit #2966

closed

freebsd 11 grep version 2.5.1

Added by htse over 7 years ago. Updated over 2 years ago.

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

0%

Estimated time:

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.


Files

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

Updated by dragonflybsd1 over 7 years 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.

Actions #2

Updated by tuxillo almost 3 years ago

  • Target version changed from 4.2 to 6.0
Actions #3

Updated by tuxillo over 2 years ago

  • Description updated (diff)
Actions #4

Updated by tuxillo over 2 years ago

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

Actions

Also available in: Atom PDF