bsd-grep-20080725_1 -v flag busted...

Stuart Barkley stuartb at 4gh.net
Wed Aug 6 00:38:52 UTC 2008


On Mon, 4 Aug 2008 at 16:32 -0000, Chuck Swiger wrote:

> (I'm much more interested in confirming whether the bug I see in BSD
> grep is reproducible by others than debating how to get real
> newlines from various shells.)

Yes, I was seeing problems building several ports with the latest
bsdgrep port.  Specifically the neon28 and avifile ports where hanging
in the ./configure phase as shown at in the original message in this
thread.

The problem appeared to be in the return code from grep.  It looked
like ./configure was in a loop doing a 'grep . file' as a method of
testing for an empty file.

Using tcsh:

    % set printexitvalue
    % /usr/bin/grep . < /dev/null
    Exit 1
    % /usr/bin/grep -V
    grep (GNU grep) 2.5.1-FreeBSD

    Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    %

    % /usr/local/bin/grep . < /dev/null
    Exit 1
    % /usr/local/bin/grep -V
    grep (BSD grep) 2.5.1-FreeBSD
    % pkg_info -I bsd-grep\*
    bsd-grep-20080723   BSD-licensed version of grep from OpenBSD
    %

    % pkg_delete bsd-grep\*
    % pkg_add ~/bsd-grep-20080725_1.tbz

    % /usr/local/bin/grep . < /dev/null
    ÿ
    % /usr/local/bin/grep -V
    grep (BSD grep) 2.5.1-FreeBSD
    % pkg_info -I bsd-grep\*
    bsd-grep-20080725_1 BSD-licensed version of grep from OpenBSD
    %

Also, note that there IS output when grepping from /dev/null with the
20080725_1 version of bsdgrep:

    % /usr/local/bin/grep . < /dev/null | hd
    00000000  ff 0a                                             |..|
    00000002
    %

Stuart Barkley


More information about the freebsd-ports mailing list