Date: Mon, 09 Jan 2012 10:40:30 +0100 From: Stefan Esser <se@freebsd.org> To: Doug Barton <dougb@FreeBSD.org> Cc: Hiroki Sato <hrs@FreeBSD.org>, freebsd-rc@FreeBSD.org Subject: Re: Making use of set_rcvar. Message-ID: <4F0AB60E.7090601@freebsd.org> In-Reply-To: <4F0A22D8.8090206@FreeBSD.org> References: <4F079A76.3030306@FreeBSD.org> <20120107112538.GC1696@garage.freebsd.pl> <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> <4F0A22D8.8090206@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Am 09.01.2012 00:12, schrieb Doug Barton: > Attached is a patch that does what I suggested a long time ago, removes > set_rcvar() entirely and assigns each rcvar statically. I'll commit this > in a few days if no one objects. (Note, it can't be committed yet > because the scripts in ports that call set_rcvar() have to be modified > first.) [...] > Index: rc.d/nscd > =================================================================== > --- rc.d/nscd (revision 229825) > +++ rc.d/nscd (working copy) > @@ -19,7 +19,7 @@ > . /etc/rc.subr > > name="nscd" > -rcvar=`set_rcvar` > +rcvar="nscd_enable" Why not generally use rcvar="${name}_enable" instead of (e.g.) rcvar="nscd_enable" in all scripts *in your patch set*, for which the outcome is the same? All except for sendmail_submit_enable, sendmail_outbound_enable, nfs_server_enable, moused_${2}_enable and clear_tmp_enable. But for nfsd vs. nfs_server and cleartmp vs. clear_tmp it might be a good idea to modify $name to match the value of the _enable parameter, anyway. Then only the special cases sendmail_*_enable and moused_*_enable would persist. The use of "${name}_enable" does not add measurable overhead, but that way more of an existing script might be used as a prototype unchanged. But using ${name}_enable enforces the use of an enable parameter that actually is based on $name, not a slight variation thereof (ISTR such cases existed and had to be fixed to avoid confusion). Regards, STefan
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F0AB60E.7090601>