From owner-freebsd-ports@FreeBSD.ORG Tue Jul 19 20:39:48 2011 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 4B33C106566B for ; Tue, 19 Jul 2011 20:39:48 +0000 (UTC) (envelope-from dieterbsd@engineer.com) Received: from mailout-us.gmx.com (mailout-us.gmx.com [74.208.5.67]) by mx1.freebsd.org (Postfix) with SMTP id E75208FC14 for ; Tue, 19 Jul 2011 20:39:47 +0000 (UTC) Received: (qmail 19913 invoked by uid 0); 19 Jul 2011 20:39:46 -0000 Received: from 67.206.183.1 by rms-us012.v300.gmx.net with HTTP Content-Type: text/plain; charset="utf-8" Date: Tue, 19 Jul 2011 20:39:42 +0000 From: "Dieter BSD" Message-ID: <20110719203944.105100@gmx.com> MIME-Version: 1.0 To: bug-followup@freebsd.org X-Authenticated: #74169980 X-Flags: 0001 X-Mailer: GMX.com Web Mailer x-registered: 0 Content-Transfer-Encoding: 8bit X-GMX-UID: /55MfUNn33erJQ7YAmtnAoYjL0tsZg2n Cc: freebsd@sopwith.solgatos.com, FreeBSD Ports Subject: Re: ports/158179: some packages do not fully honor -P dir option in pkg_add(1) 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, 19 Jul 2011 20:39:48 -0000 >> 1. Spell out very clearly its purpose - is it to populate a jail, for >> example? > > Populating a chroot/jail is one purpose. Whoops, it occurs to me that using -P to populate a chroot/jail would only work for simple cases. There is the -C option, but it "needs to be a fairly complete file system, including everything normally needed by pkg_add to run" which could be problematic, as you may want the chroot/jail to have the absolute minimum possible. So to populate a chroot/jail we'd want to be able to specify two directories: one for the real path, and one for the after-chrooting path. The -c option is available. Say a package has the binary bin/foo and the config file etc/foo.conf. 1) Pkg_add would install /usr/local/bin/foo and /usr/local/etc/foo.conf. 2) Pkg_add -P /bar would install /bar/bin/foo and /bar/etc/foo.conf. 3) Pkg_add -c /chroot would install /chroot/bin/foo and /chroot/etc/foo.conf. 4) Pkg_add -c /chroot -P /bar would install /chroot/bar/bin/foo and /chroot/bar/etc/foo.conf. In cases 2 and 4, the foo binary would have to have some way to know to look for foo.conf in /bar/etc rather than /usr/local/etc. Perhaps CONFIG_PATH ? But in the general case, we'd need a lot of *PATHs. Or a way to set PREFIX at install time. (But how?) Or...?