Re: Test failures with GNU grep 2.23
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Feb 19, 2016, 17:27 UTC
- Message-ID
- <CAPig+cQ0v4edA58=W3YdGUSDc8MeDC3H3Y=-s26ND4=hXj2bpg@mail.gmail.com>
- In-Reply-To
- <20160219115928.GA10204@sigill.intra.peff.net>
On Fri, Feb 19, 2016 at 6:59 AM, Jeff King <peff@peff.net> wrote:
Show 12 quoted lines
> On Sun, Feb 07, 2016 at 04:25:40PM +0000, John Keeping wrote:
>> The following patch fixes the tests for me, but I wonder if "-a" is
>> supported on all target platforms (it's not in POSIX, which specifies
>> that the "input files shall be text files") or whether we should do
>> something more comprehensive to provide sane_{e,f,}grep which guarantee
>> to treat input as text.
>>
>> I also tried setting POSIXLY_CORRECT but that doesn't affect the
>> text/binary decision.
>
> Yeah, I'd worry that "-a" is not portable. OTOH, BSD grep seems to have
> it, so between that and GNU, I think most systems are covered.Mac OS X grep seems to support -a and tests in t8005 still pass with -a added to the egrep invocations.
Show 21 quoted lines
> We could > do: > > test_lazy_prereq GREP_A ' > echo foo | grep -a foo > ' > > and mark these tests with it. I'd also be happy to skip that step and > just do it if and when somebody actually complains about a system > without it (I wouldn't be surprised if most people on antique systems > end up installing GNU grep anyway). > > Another option might be using "sed -ne '/^author/p'" or similar. But > that may very well just be trading one portability problem for another. > > I also wondered whether we could get away without grepping at all here. > But the blame output has a bunch of cruft we don't care about; I think > the readability of the tests would suffer if we tried to match the whole > thing in a test_cmp. > > -Peff