From owner-freebsd-stable@FreeBSD.ORG Mon Nov 12 10:24:59 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5936D11E for ; Mon, 12 Nov 2012 10:24:59 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id C719E8FC13 for ; Mon, 12 Nov 2012 10:24:58 +0000 (UTC) Received: by mail-bk0-f54.google.com with SMTP id jm19so1332450bkc.13 for ; Mon, 12 Nov 2012 02:24:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ShwTFwo88RTgruVWoxA2wJWwr3IAici2m7ZwjEDOLrg=; b=u6LedxjhR/pb8SlKhhOpt4KDQp+AzTHJl8ODQvYSDMwfdRPzSot3FyQfCwo9DjvkTV 16xJfLWx+FEUBGpz6R68smsNTJsCns/t3tWu0tmhuOz5WTcIm+6QAjRgEilsFQ08yPVa UrmBAtt1RX609VTuYqFnaj4pmOZosvz7C8yrv51ZsQ8C3ls4lrMz/fwtwXHAW6GLOO1m JazCN6ASEpC2TiIQsIF+wzjjMYqxXzeoNCNXzr6vtTo9DLWWRUgwswEtN+uwPwgppz2I wYFzEs5CZDtyovyMQWAXIJTIJ8V+lDz6SbupPsSpMe+PJCGVleW89DfGqNW5C+caZgK/ KpUw== MIME-Version: 1.0 Received: by 10.204.150.213 with SMTP id z21mr7083011bkv.45.1352715897653; Mon, 12 Nov 2012 02:24:57 -0800 (PST) Received: by 10.204.50.197 with HTTP; Mon, 12 Nov 2012 02:24:57 -0800 (PST) Received: by 10.204.50.197 with HTTP; Mon, 12 Nov 2012 02:24:57 -0800 (PST) In-Reply-To: <20121112085524.GA52287@psconsult.nl> References: <20121112051229.GA1235@mycenae.sbb.rs> <20121112085524.GA52287@psconsult.nl> Date: Mon, 12 Nov 2012 10:24:57 +0000 Message-ID: Subject: Re: nomenclature for conf files From: Chris Rees To: Paul Schenkeveld Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: FreeBSD , Zoran Kolic X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2012 10:24:59 -0000 On 12 Nov 2012 08:55, "Paul Schenkeveld" wrote: > > On Mon, Nov 12, 2012 at 08:29:27AM +0000, Chris Rees wrote: > > On 12 Nov 2012 05:20, "Kurt Buff" wrote: > > > > > > On Sun, Nov 11, 2012 at 9:12 PM, Zoran Kolic wrote: > > > > It might sound stupid, but I'd like to know if there's > > > > any difference. Are those 3 line the same? > > > > > > > > WITH_KMS=YES > > > > WITH_KMS="YES" > > > > WITH_KMS=yes > > > > > > With regard to their use in /etc/rc.conf, no, absolutely not. > > > > > > In general, from my experience, only the second one will work. > > > > > > This might, or might not, be true for other uses, but rc.conf is > > > pretty picky about this. > > > > All three are fine in make.conf and rc.conf > > > > The issue with rc.conf is when people put spaces around the = sign. > > > > Chris > > Indeed /etc/rc (executed by /bin/sh) accepts all three forms because > quotes are optional in /bin/sh and /etc/rc.subr (sourced by /etc/rc) > matches the value against "[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1". > > Also, the FreeBSD makefiles and sources test all WITH_* variables with > .ifdef or #ifdef so the value doesn't matter and can even be empty. > White space around the = is permitted too (but not in rc.conf!). > > However, things are different when people start using tools to maintain > rc.conf/make.conf. If not written with the above in mind, these tools > may have problems parsing these files. > > It's good practice to be consistent and use a canonical form that > matches the documentation or example files as this is probably the > syntax that is guarenteed to not confuse such tools. In other words: > "Be conservative in what you send [write], liberal in what you accept". Doesn't sound like a very good tool if it can't handle quoting and capital letters, but I accept the principle. Quotes in Makefiles are often harmful, so good practice IMO is to only use them when necessary. Chris