Subject: how to conditionally set variable?
To: None <>
From: Jukka Salmi <>
List: tech-pkg
Date: 02/13/2006 15:55:09

I'd like to define ALLOW_VULNERABLE_PACKAGES when building
lang/sun-jdk15 or lang/sun-jre15, and not to define it when building
other packages. I added

.if empty(PKGNAME:Nsun-jdk15-*:Nsun-jre15-*)

to /etc/mk.conf; this seems to work fine for the sun-j(dk|re)15
packages, but when building some (not all!) other packages, I get

$ cd ../../www/ap-ssl
$ make clean
make: "/etc/mk.conf" line 88: Malformed conditional (empty(PKGNAME:Nsun-jdk15-*:Nsun-jre15-*))
make: "/etc/mk.conf" line 88: Missing dependency operator
make: "../../mk/../../mk/" line 617: if-less endif
make: "../../mk/../../mk/" line 617: Need an operator
make: Fatal errors encountered -- cannot continue
make: "../../security/openssl/../../security/openssl/" line 32: warning: "cd ../../security/openssl &&                              /usr/bin/make show-var _MAKE=/usr/bin/make OPSYS=NetBSD OS_VERSION=3.99.15 LOWER_OS_VERSION=3.99.15 LOWER_OPSYS=netbsd DIGEST=/usr/pkg/bin/digest DIGEST_VERSION=20050731 PKGTOOLS_VERSION=20060123 _PKGSRCDIR=/usr/pkgsrc VARNAME=PKG_OPTIONS" returned non-zero status
===> do-clean [ap-ssl-2.8.25nb2] ===> Cleaning for ap-ssl-2.8.25nb2


$ cd ../apache
$ make clean
===> do-clean [apache-1.3.34nb5] ===> Cleaning for apache-1.3.34nb5

Why do I get this error, and why do I get it only for some packages?
And what is the correct way to define a variable depending on what
package is being built?

TIA, Jukka

bashian roulette:
$ ((RANDOM%6)) || rm -rf ~