Making use of set_rcvar.

Pawel Jakub Dawidek pjd at FreeBSD.org
Fri Jan 13 14:12:11 UTC 2012


On Fri, Jan 13, 2012 at 01:57:11AM -0800, Doug Barton wrote:
> On 01/09/2012 05:35, Hiroki Sato wrote:
> >  I prefer to use ${name}_enable because putting the same keyword in
> >  two places always leads to a stupid typo issue.
> 
> So, here's the thing. I understand what you're saying, I really do. The
> problem is, you're still wrong. :)
> 
> There are MANY places where you have to use the value of $name literally
> already, and typos count in every single one of them:
> 
> 1. The name of the script file
> 2. PROVIDE
> 3. REQUIRE
> 4. names of service-specific methods, e.g.: start_precmd="foo_prestart"
> 5. Default values in /etc/defaults/rc.conf
> 6. rc.conf.5
> 
> And that's just off the top of my head. The ideal of being able to
> copy/paste example rc.d scripts for use with new services without having
> to change [m]any code sounds great in theory. In practice, search and
> replace is an absolute necessity. So having one more place where you
> have to replace the name of the old service with the new one isn't going
> to hurt anything.

But if we can avoid it, why not? You gave no argument (valid one) why
using variables is wrose than hardcoding names everywhere.

> I haven't seen any objection to the _substance_ of my proposal, so I'm
> going to go ahead with it tomorrow.

Please don't. Touching so many rc.d files is PITA during mergemaster.
If we want to do that, let's do that once. The current consensus as I
see it, is that you are the only one wanting to hardcode names and there
are many in favour of using variables.

-- 
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://yomoli.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-rc/attachments/20120113/b2eb1bb2/attachment.pgp


More information about the freebsd-rc mailing list