From owner-freebsd-rc@FreeBSD.ORG Mon Jan 9 09:54:02 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 805371065673 for ; Mon, 9 Jan 2012 09:54:02 +0000 (UTC) (envelope-from se@freebsd.org) Received: from nm1-vm0.bullet.mail.ne1.yahoo.com (nm1-vm0.bullet.mail.ne1.yahoo.com [98.138.91.74]) by mx1.freebsd.org (Postfix) with SMTP id 0409E8FC16 for ; Mon, 9 Jan 2012 09:54:01 +0000 (UTC) Received: from [98.138.90.56] by nm1.bullet.mail.ne1.yahoo.com with NNFMP; 09 Jan 2012 09:40:30 -0000 Received: from [98.138.226.30] by tm9.bullet.mail.ne1.yahoo.com with NNFMP; 09 Jan 2012 09:40:30 -0000 Received: from [127.0.0.1] by smtp201.mail.ne1.yahoo.com with NNFMP; 09 Jan 2012 09:40:29 -0000 X-Yahoo-Newman-Id: 977230.91659.bm@smtp201.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: M9o5FVMVM1m_Dk.o8BaobB6bMGfokYuwZoESTRoec1M5Lz2 uNJnnTiZEoKkNv1o0aoLRUu_Ab8FmjeMgIPk6RoZ5N97INzu.uED.cyVu1Fx mG5Ox9vUxhi0YFqLTTQPxRTJ1P6mfETKbVw4s5xv1FEVSOmOEd8_Hf3cYO_3 nFV9Rpo_iCuVORqPy57MwqnmAjESkdWgqQWLF3Or4RhFqH8OiK3..Vc2KV6t M72opBfJX1AMhVWqNX.XbsXEP1TXSUtWAo1_re_0BPWjcm.UkyOYP01J6G8M TjPTha5Bq6rxCslfIrCqB7GlfIUIaO4vauaQd_RTEYAChK8rO0cgjgNOV4Fi PTnwH.R76WVJxb5qh2T_HoDL1u6wMr7x7K2O9XbjR9Yr4.UOoRxjUpaadDIj 2KGdA5OTU5oaJCzOoiTiE7xZsq_w- X-Yahoo-SMTP: iDf2N9.swBDAhYEh7VHfpgq0lnq. Received: from [192.168.119.20] (se@81.173.145.201 with plain) by smtp201.mail.ne1.yahoo.com with SMTP; 09 Jan 2012 01:40:29 -0800 PST Message-ID: <4F0AB60E.7090601@freebsd.org> Date: Mon, 09 Jan 2012 10:40:30 +0100 From: Stefan Esser User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Doug Barton References: <4F079A76.3030306@FreeBSD.org> <20120107112538.GC1696@garage.freebsd.pl> <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> <4F0A22D8.8090206@FreeBSD.org> In-Reply-To: <4F0A22D8.8090206@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Hiroki Sato , freebsd-rc@FreeBSD.org Subject: Re: Making use of set_rcvar. X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 09:54:02 -0000 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