Date: Tue, 19 Jul 2011 20:40:16 GMT From: "Dieter BSD" <dieterbsd@engineer.com> To: freebsd-ports-bugs@FreeBSD.org Subject: Re: ports/158179: some packages do not fully honor -P dir option in pkg_add(1) Message-ID: <201107192040.p6JKeGRj038770@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/158179; it has been noted by GNATS. From: "Dieter BSD" <dieterbsd@engineer.com> To: bug-followup@freebsd.org Cc: FreeBSD Ports <freebsd-ports@freebsd.org>,freebsd@sopwith.solgatos.com Subject: Re: ports/158179: some packages do not fully honor -P dir option in pkg_add(1) Date: Tue, 19 Jul 2011 20:39:42 +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...?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201107192040.p6JKeGRj038770>