From owner-freebsd-rc@FreeBSD.ORG Mon Apr 1 20:30:18 2013 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EF5EE76D; Mon, 1 Apr 2013 20:30:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D085BEF3; Mon, 1 Apr 2013 20:30:16 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA28419; Mon, 01 Apr 2013 23:30:15 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1UMlMt-0006Ta-0F; Mon, 01 Apr 2013 23:30:15 +0300 Message-ID: <5159EE54.8070906@FreeBSD.org> Date: Mon, 01 Apr 2013 23:30:12 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130321 Thunderbird/17.0.4 MIME-Version: 1.0 To: John Baldwin Subject: Re: rc.subr: disabling globbing while processing devfs rules References: <514D6AC5.8010409@FreeBSD.org> <201304011406.50417.jhb@freebsd.org> <20130401195601.GA47384@stack.nl> <201304011616.15191.jhb@freebsd.org> In-Reply-To: <201304011616.15191.jhb@freebsd.org> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-current@FreeBSD.org, freebsd-rc@FreeBSD.org X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.14 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, 01 Apr 2013 20:30:19 -0000 on 01/04/2013 23:16 John Baldwin said the following: > On Monday, April 01, 2013 3:56:01 pm Jilles Tjoelker wrote: >> On Mon, Apr 01, 2013 at 02:06:50PM -0400, John Baldwin wrote: >>> Why not use 'local -' instead of the $- magic? That is: >> >>> devfs_rulesets_from_file() >>> { >>> local file _err _me - >>> >>> ... >>> set -f >>> ... >>> } >> >>> That would seem to be simpler. >> >> I had mentioned this possibility on IRC, but this feature is specific to >> Almquist-derived shells (ash) and so something more portable was >> selected. (It's still not standard because POSIX does not specify >> "local" but it works on most shells in use.) > > rc.subr isn't meant to be portable, it's a script that is part of the FreeBSD > base system. I find the 'local -' syntax more readable (and used the feature > quite a bit in etcupdate). > You have to set an example in etc/ :-) I used a script in etc/rc.d as a starting point, Jilles guided me from there. -- Andriy Gapon