Subject: Accurately determining PKGNAME in mk.conf
To: None <tech-pkg@netbsd.org>
From: David Brownlee <abs@NetBSD.org>
List: tech-pkg
Date: 07/31/2007 14:59:53
 	Its currently not possible to add checks to mk.conf based
 	on the PKGNAME, as various packages set PKGNAME _after_
 	mk.conf has been included - such as firefox, ups-nut,
 	ap-php.

 	One victim of this is optimize_gcc.mk from cpuflags, but
 	this breaks any attempt to conditionalise variables in
 	mk.conf based on PKGNAME, for example setting PKG_SYSCONFBASE=/etc
 	or ALLOW_VULNERABLE_PACKAGES=1 for a subset of packages.

 	The obvious options are:
 	    a) Anyone wanting to od this has to hand craft workarounds for
 	       every affected package relevant to them in mk.conf
 	       -- This is the current state

 	    b) Enforce that PKGNAME must be set to a valud which can be
 	       fully evaluated before mk.conf is included, and add a test
 	       to the mk files to bail out if this is not the case.
 	       -- This could further complicate the logic for packages
 		  which play games with PKGNAME setting, but in some ways
 		  this is not a bad thing.

 	    c) Have an option for mk.conf to be included a second time
 	       after everything else has been evaluated, for example if
 	       a variable like 'MK_CONF_POSTINCLUDE' is set in mk.conf, it
 	       will be included a second time after everything else with
 	       a flag to indicate it is the post include

 	    d) Support PKG_SYSCONFBASE.${PKGNAME} and similar variables
 	       which can ovverride the default PKG_SYSCONFBASE values.

 	    e) Something else which I've missed. Anyone? Anyone?

 	'd)' may be the cleanest - what do people think
-- 

 		David/absolute       -- www.NetBSD.org: No hype required --