Subject: Re: Malformed conditional (!empty(MANINSTALL:Mcatinstall))
To: Todd Vierling <tv@pobox.com>
From: Simon J. Gerraty <sjg@crufty.net>
List: tech-pkg
Date: 08/21/2003 16:04:14
>: Note that if MANINSTALL is defined, its ok (same with -current make etc).
>: That said, empty() shouldn't vomit if a variable is undefined - it should
>: count as "empty".

>from a defined but empty one.  I'll concede that it probably won't harm much
>if empty() is true for undefined variables, but this problem also hits
>comparison tests like '.if ${FOO} != "bar"'.

The later is asking for trouble unless you have something like:

FOO?= fu
.if ${FOO} != "bar"

or

.if ${FOO:Ufu} != "bar"

In the case of empty(VAR:Mstring), I'm hard pressed to see why it should
blow-up if VAR is undefined.

>definition first, e.g. '.if defined(FOO) && !empty(FOO:...)'.

Yes, though ISTR some of the more complex ones blow-up anyway such that
you have to do:

.if defined(FOO)
.if ...

--sjg