From owner-freebsd-current@FreeBSD.ORG Mon Apr 1 20:17:05 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0A6C01F7; Mon, 1 Apr 2013 20:17:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id DC422E34; Mon, 1 Apr 2013 20:17:04 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id EF67EB977; Mon, 1 Apr 2013 16:17:03 -0400 (EDT) From: John Baldwin To: Jilles Tjoelker Subject: Re: rc.subr: disabling globbing while processing devfs rules Date: Mon, 1 Apr 2013 16:16:15 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <514D6AC5.8010409@FreeBSD.org> <201304011406.50417.jhb@freebsd.org> <20130401195601.GA47384@stack.nl> In-Reply-To: <20130401195601.GA47384@stack.nl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201304011616.15191.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 01 Apr 2013 16:17:04 -0400 (EDT) Cc: freebsd-current@freebsd.org, freebsd-rc@freebsd.org, Andriy Gapon X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Apr 2013 20:17:05 -0000 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). -- John Baldwin