Subject: Re: ${ENV} vs. ${SETENV}
To: Hubert Feyrer <hubert@feyrer.de>
From: Greg A. Woods <woods@weird.com>
List: tech-pkg
Date: 04/10/2005 20:59:39
[ On Friday, April 8, 2005 at 20:52:11 (+0200), Hubert Feyrer wrote: ]
> Subject: Re: ${ENV} vs. ${SETENV} 
>
> On Fri, 8 Apr 2005, Todd Vierling wrote:
> > For pkgsrc, Bourne compatibility is guaranteed, as a large amount of just
> > bsd.pkg.mk is shellcode blocks embedded in make commands.
> 
> true... so what do we keep SETENV/env for? :>

I find it _extremely_ helpful to use something like the following:

Index: mk/platform/NetBSD.mk
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/mk/platform/NetBSD.mk,v
retrieving revision 1.5
diff -u -r1.5 NetBSD.mk
--- mk/platform/NetBSD.mk	16 Nov 2004 18:04:00 -0000	1.5
+++ mk/platform/NetBSD.mk	7 Jan 2005 17:45:42 -0000
@@ -59,11 +57,16 @@
 RMDIR?=		/bin/rmdir
 RSH?=		/usr/bin/rsh
 SED?=		/usr/bin/sed
-SETENV?=	/usr/bin/env
+SETENV?=	/usr/bin/env -i
 SH?=		/bin/sh
 SHLOCK=		/usr/bin/shlock
 SORT?=		/usr/bin/sort


This ensures my well-populated private environment doesn't affect any
build in any unexpected way (only the pkgsrc makefiles themselves pay
attention to my environment, as desired; not any of the package's own
build tools -- they can only see the environment handed to them by
pkgsrc).

-- 
						Greg A. Woods

H:+1 416 218-0098  W:+1 416 489-5852 x122  VE3TCP  RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>