Subject: Re: boolean variables in pkgsrc
To: Roland Illig <roland.illig@gmx.de>
From: Johnny Lam <jlam@NetBSD.org>
List: tech-pkg
Date: 02/11/2005 17:13:55
Roland Illig wrote:
>
> I'd like to clean up all the uses of boolean variables that are set to
> #defined instead of YES/yes/NO/no and to modify all the queries to be of
> the second form (:M[Yy][Ee][Ss]). Personally I prefer the lowercase
> yes/no, but there seem to be many that prefer uppercase, so I won't try
> to change that.
Changing the semantics of these variables gets pretty ugly fairly
quickly because you need to worry about existing /etc/mk.conf files when
someone uses the next branch of pkgsrc. We actually *just* had this
same problem because pkgsrc had defined/undefined semantics for USE_PAM,
but bsd.own.mk (in NetBSD-current) suddenly started setting it to
yes/no, which broke packages that expected the old behavior.
I would prefer to see most of these variables deprecated and for the
packages that use these variables to be converted to use bsd.options.mk.
In that case, the rule of thumb is to keep the old variables around
for one more branch, then then to remove them from pkgsrc. The right
way to remove them is to move them to the defaults/mk/obsolete.mk file
with a note that says when to delete them from pkgsrc. For example, to
deprecate USE_OSS, we'd move it over to defaults/mk/obsolete.mk with:
# USE_OSS will be removed after the 2005-Q2 branch.
.if defined(USE_OSS)
PKG_DEFAULT_OPTIONS+= oss
.endif
And then change all packages that use USE_OSS to accept the global "oss"
option using the bsd.options.mk framework.
Cheers,
-- Johnny Lam <jlam@NetBSD.org>