bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-grep] grep-2.5.1a: "make check" fails on NetBSD/sparc-1.5


From: Adrian Bunk
Subject: Re: [bug-grep] grep-2.5.1a: "make check" fails on NetBSD/sparc-1.5
Date: Sat, 8 Jan 2005 01:14:41 +0100
User-agent: Mutt/1.5.6+20040907i

On Fri, Jan 07, 2005 at 02:36:30PM +0100, Stepan Kasal wrote:

> Hello,

Hi Stepan,

> On Fri, Jan 07, 2005 at 12:25:20PM +0100, Adrian Bunk wrote:
> > > Could you please debug the problem and perhaps write a patch?
> > 
> > Am I right to assume this was a joke?
> 
> well, it wasn't meant as a joke, but I admit it was an unfortunate
> formulation.
> 
> I, for example, quite enjoy looking for bugs in other projects, but
> it's resonable to report them first, because they may have already been
> fixed.
> 
> I apologize for that unfortunate sentence.
> And I'd like to repeat my ``thank you'' for the bug report.  Without
> that, I'd have no chance to fix the bug, of course.

apologize accepted.

> > Status: Wrong status code, test \#6 failed
> > Status: Wrong status code, test \#7 failed
> > FAIL: status.sh
> 
> So it seems the compiled grep is not handling -q correctly.
> If you are willing to help me with debugging again, could you please 
> try the following:
> 
> echo abc | src/grep -q a ; echo $?

Prints 0.

> echo abc | src/grep -q a - ; echo $?
> echo abc | src/grep -q a - nonexistent.File ; echo $?
> echo abc | src/grep -q a nonexistent.File - ; echo $?

All 3 say:

grep: illegal option -- -
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
2


> The output should be 0 in all four cases.  The last command prints
> 
>       grep: nonexistent.File: No such file or directory
> 
> to stderr, but it should then exit with status 0.
> 
> In all these examples, grep should exist on the same line.  So if you apply
> the tiny patch attached to this mail, grep should say here in all four cases.
> Is it the case?
>...

It does only in the first case.

After seeing this error message, it seems to be that the getopt_long() 
shipped with NetBSD 1.5 does not exactly do what you expect from it.

Note that I'm using a relatively old version of NetBSD (NetBSD 2.0 is 
two major releases more recent).

I've attached the man page from NetBSD 1.5 .

I tried
  ./configure  --with-included-getopt
and this fixed the problem.

You should change configure.in to check for exactly what you need from 
getopt_long(), or check for a GNU getopt_long() and use the included 
one even if a non-GNU implementation was found.

> Have a nice day,
>       Stepan Kasal
>...

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

Attachment: getopt_long.3
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]