Subject: Re: [RFC] making PKGBASE and PKGVERSION read-only
To: Roland Illig <roland.illig@gmx.de>
From: Todd Vierling <tv@duh.org>
List: tech-pkg
Date: 10/17/2005 14:44:59
On Sat, 15 Oct 2005, Roland Illig wrote:
> The confusion of my last RFC arose from wrong code in bsd.pkg.mk.
>
> It is common practice to initialize user-settable variables using the "?="
> operator. But this operator is used in too many places. For example, the
> variables PKGBASE and PKGREVISION, which are probably not intended to be
> user-settable, are defined with it.
>
> This patch makes these variables practically read-only.
And slower to parse.
Part of the reason that ?= is so liberally used is because it is fast for
the make parser (not to mention concise). Yes, that means that the user has
a lot of rope to hang him/herself if a non-user variable is modified in
mk.conf, but that's not unusual for Unix applications in general.
> This patch also reduces the confusion that might arise because the PKGNAME and
> PKGNAME_NOREV are assigned using the ":=" operator.
Why? That's what documentation is meant to address.
--
-- Todd Vierling <tv@duh.org> <tv@pobox.com> <todd@vierling.name>