Date: Wed, 27 Dec 2006 15:57:04 -0800 From: Doug Barton <dougb@FreeBSD.org> To: Yar Tikhiy <yar@comp.chem.msu.su> Cc: freebsd-rc@freebsd.org Subject: Re: rc.d namespace Message-ID: <45930850.4070906@FreeBSD.org> In-Reply-To: <20061227105630.GB21493@comp.chem.msu.su> References: <20061227105630.GB21493@comp.chem.msu.su>
next in thread | previous in thread | raw e-mail | index | archive | help
Yar Tikhiy wrote:
> Hi folks,
>
> My attention has been drawn by the fact that rc.subr and rc.d/*
> don't seem to follow uniform namespace rules.
In general I'm in favor of consistency, but could you be more specific
about what problem you're trying to solve?
> Namely both rc.subr
> and rc.d use global identifiers starting with an underscore.
> Fortunately, rc.subr doesn't seem to use global identifiers not
> starting with an underscore besides the names exported to scripts
> on purpose.
That's good news.
> What do you think about adopting the following rule: "_foo" names
> are for the rc.subr internals while just "foo" names are for rc.d
> scripts?
That works for me, especially if we don't have to make a lot of
gratuitous changes to rc.subr. I would like to minimize the pain of
adopting any new stuff from NetBSD if possible.
> Another possible way is: __foo or even __rc_foo for
> rc.subr, _foo for scripts, foo for the documented rc.subr interface.
Personally I think that's too much drama. Since they are executed in a
subshell, I don't really see a need for variables in individual rc.d
scripts to be so careful about their namespace that they need
something like _foo to start with, so I'd rather "enforce" this for
the scripts than make radical changes to rc.d itself.
Doug
--
This .signature sanitized for your protection
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45930850.4070906>
