Date: Fri, 9 Jul 2004 21:47:35 +0100 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: freebsd-questions@freebsd.org Subject: Re: "make search" oddity Message-ID: <20040709204735.GA37067@happy-idiot-talk.infracaninophile.co.uk> In-Reply-To: <20040709192245.GC11771@millerlite.local.mark-and-erika.com> References: <20040708172916.GB15679@millerlite.local.mark-and-erika.com> <20040708192245.GA11705@happy-idiot-talk.infracaninophile.co.uk> <20040708202313.GA11771@millerlite.local.mark-and-erika.com> <20040708210535.GA57010@happy-idiot-talk.infracaninophile.co.uk> <20040709192245.GC11771@millerlite.local.mark-and-erika.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--liOOAslEiF7prFVr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
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:
> >=20
> > NOTE: In versions of gawk prior to 3.0, IGNORECAS=
E only
> > affected regular expression operations. It now =
affects
> > string comparisons as well.
>=20
> 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.
=20
> 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=3D1; } /ab/ { print "IGNORECASE wor=
ks" }'
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. =20
> 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
--=20
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
--liOOAslEiF7prFVr
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)
iD8DBQFA7wRniD657aJF7eIRAvJIAJsEoyhu5gGBMgfI33zr/OVq+v8DnwCdHSFQ
2Hjpo2M1qiMXwTnoAvlS/xM=
=tbnN
-----END PGP SIGNATURE-----
--liOOAslEiF7prFVr--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040709204735.GA37067>
