Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Jan 2012 15:11:00 +0100
From:      Pawel Jakub Dawidek <pjd@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:  <20120113141058.GE1662@garage.freebsd.pl>
In-Reply-To: <4F0FFFF7.4090105@FreeBSD.org>
References:  <4F08C95F.6040808@FreeBSD.org> <20120108.081216.1547061187942402256.hrs@allbsd.org> <4F0A22D8.8090206@FreeBSD.org> <20120109.223510.1979757999064039809.hrs@allbsd.org> <4F0FFFF7.4090105@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--8JPrznbw0YAQ/KXy
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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.
>=20
> So, here's the thing. I understand what you're saying, I really do. The
> problem is, you're still wrong. :)
>=20
> There are MANY places where you have to use the value of $name literally
> already, and typos count in every single one of them:
>=20
> 1. The name of the script file
> 2. PROVIDE
> 3. REQUIRE
> 4. names of service-specific methods, e.g.: start_precmd=3D"foo_prestart"
> 5. Default values in /etc/defaults/rc.conf
> 6. rc.conf.5
>=20
> 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.

--=20
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://yomoli.com

--8JPrznbw0YAQ/KXy
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iEYEARECAAYFAk8QO3IACgkQForvXbEpPzRn2gCg7G4TwPIQOsa3vzAeJ/c+90XV
9a4AoID/05u528Rd5GJmPDzmTdxdD1mG
=/4TM
-----END PGP SIGNATURE-----

--8JPrznbw0YAQ/KXy--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120113141058.GE1662>