From owner-freebsd-ports@FreeBSD.ORG Tue May 18 23:18:19 2010 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 560E8106566B; Tue, 18 May 2010 23:18:19 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.152]) by mx1.freebsd.org (Postfix) with ESMTP id 745FE8FC0C; Tue, 18 May 2010 23:18:18 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 22so1780634fge.13 for ; Tue, 18 May 2010 16:18:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=EydFNFP9G+nAKpnxOPOyxgRMeFytAiTnWLl2BHCOvyQ=; b=LPqWZ65MKxHv/W6Pd+0Nb55r+cymlISPretLmTyhsBmkN4P9HDWpnW0oRVWogN4Y1m r5HgGwT78bGavRgonjCzUOwQVuF1keDC+3aJIVpsv9XaidLaYw+6D37n9DJoD7rvoas4 H8vRfpwfnz4TPp7o6+7r2UiV6Q9dCx24BK7U4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=N6Aq0axGS4ECf/d1L5WhelrJzOzPY+YBOFJ+RUpOGy5JSB0dAsuPxnTCtoo+j15Y5t OkdDdOc/Ibj3ay2hFsQwUJE/ry8NsTytKCYAe6zRjqLZpL1bsPYJz+4wKjpuZAPq9rBq vj7rfPKvRfgNs7T1gEClX7nvVZu2UXRhCYVEI= Received: by 10.86.239.14 with SMTP id m14mr11779922fgh.78.1274224695660; Tue, 18 May 2010 16:18:15 -0700 (PDT) Received: from localhost (95-25-188-72.broadband.corbina.ru [95.25.188.72]) by mx.google.com with ESMTPS id l12sm10198824fgb.27.2010.05.18.16.18.14 (version=SSLv3 cipher=RC4-MD5); Tue, 18 May 2010 16:18:15 -0700 (PDT) From: Anonymous To: Doug Barton References: <86hbm5yjjh.fsf@gmail.com> <20100518115611.GA45921@atarininja.org> <4BF28470.2050903@infracaninophile.co.uk> <86hbm5vycg.fsf@gmail.com> <20100518195725.GB48168@atarininja.org> <4BF2F6AD.3020709@FreeBSD.org> <20100518203610.GA50328@atarininja.org> <86d3wsub3u.fsf@gmail.com> <4BF31322.60208@FreeBSD.org> Date: Wed, 19 May 2010 03:18:13 +0400 In-Reply-To: <4BF31322.60208@FreeBSD.org> (Doug Barton's message of "Tue, 18 May 2010 15:22:26 -0700") Message-ID: <86632kol3e.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Wesley Shields , freebsd-ports@freebsd.org Subject: Re: preferred place for system-wide config files X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 May 2010 23:18:19 -0000 Doug Barton writes: > On 5/18/2010 2:57 PM, Anonymous wrote: >> Wesley Shields writes: >> >>> On Tue, May 18, 2010 at 01:21:01PM -0700, Doug Barton wrote: >>>> In the world where PREFIX and LOCALBASE are different, PREFIX cannot be >>>> relied on to exist after the port is installed. Therefore regarding >>>> configuration files that are not installed by the port the thing >>>> installed (for example portmaster) should look for its configuration >>>> files in LOCALBASE. >>> >>> Yes, I agree with this. >> >> This is ambiguous. Why PREFIX persistence is relevant here when we're >> talking about one port and not about collaboration of several ports? > > There are 2 possible circumstances. One is that PREFIX == LOCALBASE, the > other is that they are not the same. In the case where they are the same > (which is far and away the most common) then everything works. > They only matter when there are dependencies on other ports. LOCALBASE can be ignored otherwise. > In the case where they are different one cannot guarantee that the > directory referred to by PREFIX will continue to exist after the port is > installed. You didn't answer how can we guarantee port being installed but PREFIX can't. PREFIX is inherent to port's intallation. It's where things install. If it doesn't exist then the thing that uses config file is some other (installed) port. > In the case where they are different PREFIX by its very > nature is ephemeral, and LOCALBASE, again, by definition, is "the local > system." And what is this "local system"? It may disappear along with PREFIX if there are no ports installed. Just because some random config file resides there doesn't make it LOCALBASE. > One could potentially imagine a scenario where installing a > port temporarily into a custom PREFIX is desirable, but the user would > still want to get settings and configuration from "the system," which is > defined to be LOCALBASE. > In case there is only one port registered PREFIX would be the only populated place. LOCALBASE would point to some non-existent path or empty directory (e.g. /usr/local). But PREFIX/etc would at least exist according to MTREE_FILE. > One could also imagine a system on which there is a LOCALBASE and lots > of little PREFIXes, each of which is designed to be an autonomous > semi-system of its own. In that case you would want a tool (like > portmaster) to look for its configuration files in PREFIX. However, this > last example is what we refer to as "an extreme corner case," which is > to say it is not something for which we ought to optimize, and is > potentially not even something for which we would want to make provisions. > So, what do you lose by using PREFIX? It's not optimization if it doesn't have side effects. > Fortunately, portmaster (which is what you initially inquired about in > your PR) already has a facility for dealing with this, the > ~/.portmasterrc file. You can of course also maintain your desired > change to portmaster's behavior as a local patch. It's same as LOCALBASE/etc. You can have only one copy of config file under $HOME for one user. > > Either way, the answer to your question, "What SHOULD portmaster be > doing?" is "Exactly what it is already doing." I'm sorry if you don't > like the answer, but continuing to discuss it is not going to change it. > This doesn't concern only portmaster. As I've mentioned previously xorg-server, subversion and git don't install any config file (not even in share/examples) but still look for it inside PREFIX not LOCALBASE. In other words almost any GNU_CONFIGURE port that doesn't install config files. I've yet to see someone modify SYSCONFDIR for such ports. > > hope this helps, > > Doug