Subject: boolean variables in pkgsrc
To: None <tech-pkg@netbsd.org>
From: Roland Illig <roland.illig@gmx.de>
List: tech-pkg
Date: 02/11/2005 18:58:09
Hi all,

I noted that some things in pkgsrc are not as consistent as they could 
(and should) be.

One thing is the use of "boolean" variables. They can be set as follows:

BOOLEAN_VAR=	# defined (means "yes")
BOOLEAN_VAR=	YES
BOOLEAN_VAR=	yes
BOOLEAN_VAR=	NO
BOOLEAN_VAR=	no

And they can be queried as follows:

.if defined(BOOLEAN_VAR)
.if !empty(BOOLEAN_VAR:M[Yy][Ee][Ss])
.if ${BOOLEAN_VAR} == "YES"

and many combinations of these three queries.


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.

Any objections?

Roland