Subject: Re: CVS commit: pkgsrc/mk
To: Alistair Crooks <agc@pkgsrc.org>
From: Johnny C. Lam <jlam@NetBSD.org>
List: pkgsrc-changes
Date: 05/13/2005 19:49:05
Alistair Crooks wrote:
> 
> How about just getting awk to do all the work, default and all?  (The
> following is not really tested)
> 
> [23:36:59] agc@sys3 ...pkgsrc/graphics/tiff 59 > pkg_info -qp libtool-base | env _DEF_=/usr/pkg2 awk 'BEGIN { p = ENVIRON["_DEF_"] } { if (NF > 0) { p = $2; exit } } END { print p }'
> /usr/pkg
> [23:37:18] agc@sys3 ...pkgsrc/graphics/tiff 60 > echo "" | env _DEF_=/usr/pkg2 awk 'BEGIN { p = ENVIRON["_DEF_"] } { if (NF > 0) { p = $2; exit } } END { print p }'
> /usr/pkg2
> [23:37:27] agc@sys3 ...pkgsrc/graphics/tiff 61 >

I decided to go with an awk-less solution to try to reduce pkgsrc's 
dependency on awk.  I did mention in my talk at pkgsrcCon that since we 
use awk quite pervasively in pkgsrc, we should probably add it to the 
bootstrap kit.  Thankfully, we now have a BSD-licensed awk in src that 
we can distribute in the bootstrap if we wish.

	Cheers,

	-- Johnny Lam <jlam@NetBSD.org>