Subject: Re: HEADS UP: RCD_SCRIPTS_EXAMPLEDIR changed to share/examples/rc.d
To: Chris Jepeway <jepeway@blasted-heath.com>
From: Greg A. Woods <woods@planix.com>
List: tech-pkg
Date: 12/29/2004 20:55:27
[ On Wednesday, December 29, 2004 at 12:28:55 (-0500), Chris Jepeway wrote: ]
> Subject: Re: HEADS UP: RCD_SCRIPTS_EXAMPLEDIR changed to share/examples/rc.d
>
> > : ${cups:=NO}
> A(n arguably) less opaque way of accomplishing same:
> 
> 	cups=${cups:-NO}

Perhaps, but not really...  :-)

The ":-" syntax says "use default values", but the value isn't being
used unless by way of the fake re-assignment.

However the ":=" syntax says "assign default values", which is _exactly_
what's desired here.  This isn't magic -- it's been almost this way
since v7 (at that time the colon (for testing for an empty value) wasn't
available, but it's been available in the BSD realm, the last to get it,
since about 4.3BSD (~1991) as far as I can tell).  It's certainly a
feature found in all /bin/sh implementations on all platforms that
pkgsrc supports or else pkgsrc wouldn't work on them in the first place.

However I think it's much safer to add a new /etc/defaults/ config file
for every RCD_SCRIPTS using package than it is to overload the use of
the /etc/rc.conf.d/ file for this purpose.  The latter is something a
user is supposed to be allowed to change while the former can be marked
as being meant to be off-limits for local changes.

-- 
						Greg A. Woods
						Planix, Inc.

<woods@planix.com>     +1 416 489-5852 x122     http://www.planix.com/