"make search" oddity

Matthew Seaman m.seaman at infracaninophile.co.uk
Fri Jul 9 13:47:43 PDT 2004


On Fri, Jul 09, 2004 at 03:22:45PM -0400, Mark Frank wrote:
> * On Thu, Jul 08, 2004 at 10:05:35PM +0100 Matthew Seaman wrote:

> > Hmmm... what awk(1) program is first on your path?  And if it isn't
> > the default version supplied with the system (/usr/bin/awk -- in 4.10
> > this is actually GNU Awk 3.0.6) does it support 'IGNORECASE'?  There's
> > this little snippet in the awk(1) man page:
> > 
> >                    NOTE: In versions of gawk prior  to  3.0,  IGNORECASE  only
> >                    affected  regular  expression  operations.   It now affects
> >                    string comparisons as well.
> 
> I only have one copy of awk on the box.  Things like awk I usually take
> for granted and don't think about.  Here's what I think I see, please
> correct me if I'm wrong.

If you're using the version of awk supplied with the system and the
systems you're running aren't hugely out of date, then you shouldn't
have a problem.
 
> On all my 5.2.1-RELEASE boxes the version of awk appears to be the
> one-true-awk which I believe is the old AT&T/Lucent awk.  I don't know
> how to extract the exact version number but obviously doesn't support
> IGNORECASE.  I've never done anything intentionally to change versions
> of awk on any of these.

Hmmm... The 5.x awk(1) man page certainly doesn't mention IGNORECASE
(which is a GNU extension and not in the POSIX awk specification). I
do think it odd that all those improvements to the ports search
facility should have been committed with a large chunk of
functionality not working under 5.x.  None the less, that appears to
have been the case.

IGNORECASE support hasn't been added to the one-true-awk in 5.x as far
as I can tell.  I can find no mention of it searching through the
sources via cvsweb.cgi -- mind you, that may well be because I just
didn't manage to search very effectively.  Could you try running this
command on a 5.x system?

    % echo aB | awk 'BEGIN { IGNORECASE=1; } /ab/ { print "IGNORECASE works" }'

On 4.x that prints out 'IGNORECASE works' -- from what you've said,
I'd expect no output on 5.x

Looks like you've spotted a bug.  

> The only 4.x system I have is a 4.8 box which has never gone through a
> buildworld/installworld cycle (it's a poor old Pentium that's just used
> as a caching DNS server in my LAN) and it does have GNU Awk 3.0.6 on it.
> If I did a buildworld/installworld on it, would it use the Makefile in
> /usr/src/usr.bin/awk, which seems to point to the source for the
> one-true-awk?

No -- 4.x uses and will use GNU awk all the way.  It's one of those
policy things: not to make potentially disruptive changes like
replacing an important application with one using a completely
different software base within the life of a system major version.

With 5.x they've switched to a BSD licensed awk(1) implementation.
They're going to do much the same with tar(1), if they haven't already
-- so long as they can make the switch before 5.3 goes stable.  If
they miss that, bsdtar will have to wait until 6.x.  Ultimately the
idea is to provide a purely BSD licensed system, but it will be quite
a long time before there's a suitable replacement for gcc(1) and the
rest of the compiler toolchain available.

> I do see the GNU version of awk in ports, gawk-3.1.1_1.  Should I be
> using that?  Will it break something else if I install it and link
> /usr/bin/awk to it?

You can certainly install gawk from ports if you want, but I wouldn't
go replacing the system version with it -- awk(1) is vital for
rebuilding world, kernel and you wouldn't want to run the risk of
breaking that.  After all, being able to do a case insensitive search
of the ports INDEX is not actually that important in the grand scheme
of things.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040709/d97d3415/attachment.bin


More information about the freebsd-questions mailing list