From nobody@FreeBSD.org  Wed Jun 22 22:23:30 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E4991106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 22 Jun 2011 22:23:30 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id D54318FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 22 Jun 2011 22:23:30 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p5MMNUAH015665
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 22 Jun 2011 22:23:30 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p5MMNUEH015663;
	Wed, 22 Jun 2011 22:23:30 GMT
	(envelope-from nobody)
Message-Id: <201106222223.p5MMNUEH015663@red.freebsd.org>
Date: Wed, 22 Jun 2011 22:23:30 GMT
From: Dieter <freebsd@sopwith.solgatos.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: packages do not fully honor -P dir option
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         158179
>Category:       ports
>Synopsis:       some packages do not fully honor -P dir option in pkg_add(1)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 22 22:30:11 UTC 2011
>Closed-Date:    Thu Nov 03 21:14:21 UTC 2011
>Last-Modified:  Thu Nov 03 21:14:21 UTC 2011
>Originator:     Dieter
>Release:        8.2
>Organization:
>Environment:
8.2 amd64
>Description:
pkg_add -P prefix installs the package under prefix instead of /usr/local.
But many packages still use /usr/local for some paths.

Example:

pkg_add -P /whatever hal-0.5.14_14.tbz
===> Creating users and/or groups.
Creating group 'haldaemon' with gid '560'.
Creating user 'haldaemon' with uid '560'.
./+INSTALL: /usr/local/bin/polkit-auth: not found
cp: /usr/local/share/hal/dist/hal.conf: No such file or directory

>How-To-Repeat:
See example above.
>Fix:


>Release-Note:
>Audit-Trail:

From: Stephen Montgomery-Smith <stephen@missouri.edu>
To: bug-followup@FreeBSD.org, freebsd@sopwith.solgatos.com,
        current@FreeBSD.org
Cc:  
Subject: Re: ports/158179: some packages do not fully honor -P dir option
 in pkg_add(1)
Date: Fri, 15 Jul 2011 21:43:42 -0500

 I was looking through the source code of pkg_add.  Personally I don't 
 see how the "-P" or "-p" option could be made to work with pkg_add. 
 Many of the installation commands involve scripts which have ${PREFIX} 
 hard coded into them.  ${PREFIX} is often hard coded when trhe package 
 is created by the port.  In my opinion, the options "-p" and "-P" should 
 be removed from pkg_add.
 
 Either that, or provide the port a way to access "@cwd" in any scripts 
 it installs.  But this would require a major overhaul of the whole ports 
 system, and probably much of the software it installs as well.
 
 Am I missing something?
 
 Stephen

From: Stefan Bethke <stb@lassitu.de>
To: Stephen Montgomery-Smith <stephen@missouri.edu>
Cc: bug-followup@freebsd.org,
 freebsd@sopwith.solgatos.com,
 current@freebsd.org
Subject: Re: ports/158179: some packages do not fully honor -P dir option in pkg_add(1)
Date: Sat, 16 Jul 2011 11:26:46 +0200

 Am 16.07.2011 um 04:43 schrieb Stephen Montgomery-Smith:
 
 > I was looking through the source code of pkg_add.  Personally I don't =
 see how the "-P" or "-p" option could be made to work with pkg_add. Many =
 of the installation commands involve scripts which have ${PREFIX} hard =
 coded into them.  ${PREFIX} is often hard coded when trhe package is =
 created by the port.  In my opinion, the options "-p" and "-P" should be =
 removed from pkg_add.
 >=20
 > Either that, or provide the port a way to access "@cwd" in any scripts =
 it installs.  But this would require a major overhaul of the whole ports =
 system, and probably much of the software it installs as well.
 >=20
 > Am I missing something?
 
 Yes.  Not honoring the prefix is a bug in the port.  If you do need to =
 do prefix-specific things during install, use pkg-install, see =
 http://www.freebsd.org/doc/en/books/porters-handbook/pkg-install.html
 
 I suspect that many ports are not well tested outside of "/usr/local", =
 but the infrastructure is there and available.
 
 
 Stefan
 
 --=20
 Stefan Bethke <stb@lassitu.de>   Fon +49 151 14070811
 
 
 

From: Stephen Montgomery-Smith <stephen@missouri.edu>
To: Stefan Bethke <stb@lassitu.de>
Cc: "bug-followup@freebsd.org" <bug-followup@freebsd.org>,
        "freebsd@sopwith.solgatos.com" <freebsd@sopwith.solgatos.com>,
        "current@freebsd.org" <current@freebsd.org>
Subject: Re: ports/158179: some packages do not fully honor -P dir option
 in pkg_add(1)
Date: Sat, 16 Jul 2011 10:37:53 -0500

 On 07/16/2011 04:26 AM, Stefan Bethke wrote:
 > Am 16.07.2011 um 04:43 schrieb Stephen Montgomery-Smith:
 >
 >> I was looking through the source code of pkg_add.  Personally I don't see how the "-P" or "-p" option could be made to work with pkg_add. Many of the installation commands involve scripts which have ${PREFIX} hard coded into them.  ${PREFIX} is often hard coded when trhe package is created by the port.  In my opinion, the options "-p" and "-P" should be removed from pkg_add.
 >>
 >> Either that, or provide the port a way to access "@cwd" in any scripts it installs.  But this would require a major overhaul of the whole ports system, and probably much of the software it installs as well.
 >>
 >> Am I missing something?
 >
 > Yes.  Not honoring the prefix is a bug in the port.  If you do need to do prefix-specific things during install, use pkg-install, see http://www.freebsd.org/doc/en/books/porters-handbook/pkg-install.html
 >
 > I suspect that many ports are not well tested outside of "/usr/local", but the infrastructure is there and available.
 
 You are correct, this needs to be done on a port by port basis.  In some 
 ports this is going to be a big job, because in some cases the 
 "/usr/local" is hard coded into certain binaries.
 
 For example, suppose the C source code contains something like:
 char applications_dir = "/usr/local/share/applications";
 and this is filled in by the ./configure script.
 
 How is that handled?

From: Chris Rees <utisoft@gmail.com>
To: Stephen Montgomery-Smith <stephen@missouri.edu>
Cc: "current@freebsd.org" <current@freebsd.org>, 
	"freebsd@sopwith.solgatos.com" <freebsd@sopwith.solgatos.com>, 
	"bug-followup@freebsd.org" <bug-followup@freebsd.org>, Stefan Bethke <stb@lassitu.de>
Subject: Re: ports/158179: some packages do not fully honor -P dir option in pkg_add(1)
Date: Sat, 16 Jul 2011 16:53:49 +0100

 --001636920d3a9e7def04a831c5ac
 Content-Type: text/plain; charset=ISO-8859-1
 
 On 16 Jul 2011 16:38, "Stephen Montgomery-Smith" <stephen@missouri.edu>
 wrote:
 >
 > On 07/16/2011 04:26 AM, Stefan Bethke wrote:
 >>
 >> Am 16.07.2011 um 04:43 schrieb Stephen Montgomery-Smith:
 >>
 >>> I was looking through the source code of pkg_add.  Personally I don't
 see how the "-P" or "-p" option could be made to work with pkg_add. Many of
 the installation commands involve scripts which have ${PREFIX} hard coded
 into them.  ${PREFIX} is often hard coded when trhe package is created by
 the port.  In my opinion, the options "-p" and "-P" should be removed from
 pkg_add.
 >>>
 >>> Either that, or provide the port a way to access "@cwd" in any scripts
 it installs.  But this would require a major overhaul of the whole ports
 system, and probably much of the software it installs as well.
 >>>
 >>> Am I missing something?
 >>
 >>
 >> Yes.  Not honoring the prefix is a bug in the port.  If you do need to do
 prefix-specific things during install, use pkg-install, see
 http://www.freebsd.org/doc/en/books/porters-handbook/pkg-install.html
 >>
 >> I suspect that many ports are not well tested outside of "/usr/local",
 but the infrastructure is there and available.
 >
 >
 > You are correct, this needs to be done on a port by port basis.  In some
 ports this is going to be a big job, because in some cases the "/usr/local"
 is hard coded into certain binaries.
 >
 > For example, suppose the C source code contains something like:
 > char applications_dir = "/usr/local/share/applications";
 > and this is filled in by the ./configure script.
 >
 > How is that handled?
 >
 
 It's not.
 
 Remember what a package is, literally the files from the plist tarred with
 some magic +FILEs and the pkg-*install files- if paths are hardcoded in
 objects that's how it'll be installed.
 
 Don't touch the -p option! It's only useful for.... um.... someone help
 here?
 
 Chris
 
 --001636920d3a9e7def04a831c5ac
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 <p><br>
 On 16 Jul 2011 16:38, &quot;Stephen Montgomery-Smith&quot; &lt;<a href=3D"m=
 ailto:stephen@missouri.edu">stephen@missouri.edu</a>&gt; wrote:<br>
 &gt;<br>
 &gt; On 07/16/2011 04:26 AM, Stefan Bethke wrote:<br>
 &gt;&gt;<br>
 &gt;&gt; Am 16.07.2011 um 04:43 schrieb Stephen Montgomery-Smith:<br>
 &gt;&gt;<br>
 &gt;&gt;&gt; I was looking through the source code of pkg_add. =A0Personall=
 y I don&#39;t see how the &quot;-P&quot; or &quot;-p&quot; option could be =
 made to work with pkg_add. Many of the installation commands involve script=
 s which have ${PREFIX} hard coded into them. =A0${PREFIX} is often hard cod=
 ed when trhe package is created by the port. =A0In my opinion, the options =
 &quot;-p&quot; and &quot;-P&quot; should be removed from pkg_add.<br>
 
 &gt;&gt;&gt;<br>
 &gt;&gt;&gt; Either that, or provide the port a way to access &quot;@cwd&qu=
 ot; in any scripts it installs. =A0But this would require a major overhaul =
 of the whole ports system, and probably much of the software it installs as=
  well.<br>
 
 &gt;&gt;&gt;<br>
 &gt;&gt;&gt; Am I missing something?<br>
 &gt;&gt;<br>
 &gt;&gt;<br>
 &gt;&gt; Yes. =A0Not honoring the prefix is a bug in the port. =A0If you do=
  need to do prefix-specific things during install, use pkg-install, see <a =
 href=3D"http://www.freebsd.org/doc/en/books/porters-handbook/pkg-install.ht=
 ml">http://www.freebsd.org/doc/en/books/porters-handbook/pkg-install.html</=
 a><br>
 
 &gt;&gt;<br>
 &gt;&gt; I suspect that many ports are not well tested outside of &quot;/us=
 r/local&quot;, but the infrastructure is there and available.<br>
 &gt;<br>
 &gt;<br>
 &gt; You are correct, this needs to be done on a port by port basis. =A0In =
 some ports this is going to be a big job, because in some cases the &quot;/=
 usr/local&quot; is hard coded into certain binaries.<br>
 &gt;<br>
 &gt; For example, suppose the C source code contains something like:<br>
 &gt; char applications_dir =3D &quot;/usr/local/share/applications&quot;;<b=
 r>
 &gt; and this is filled in by the ./configure script.<br>
 &gt;<br>
 &gt; How is that handled?<br>
 &gt;</p>
 <p>It&#39;s not.</p>
 <p>Remember what a package is, literally the files from the plist tarred wi=
 th some magic +FILEs and the pkg-*install files- if paths are hardcoded in =
 objects that&#39;s how it&#39;ll be installed.</p>
 <p>Don&#39;t touch the -p option! It&#39;s only useful for.... um.... someo=
 ne help here?</p>
 <p>Chris<br>
 </p>
 
 --001636920d3a9e7def04a831c5ac--

From: Chris Rees <crees@freebsd.org>
To: "bug-followup@freebsd.org" <bug-followup@freebsd.org>, "ports@freebsd.org" <ports@freebsd.org>, 
	StephenMontgomery-Smithstephen@freebsd.org, Stefan Bethke <stb@lassitu.de>
Cc:  
Subject: Fwd: Re: ports/158179: some packages do not fully honor -P dir option
 in pkg_add(1)
Date: Sat, 16 Jul 2011 17:01:17 +0100

 --001636920d3a573ef904a831e0c0
 Content-Type: text/plain; charset=ISO-8859-1
 
 Taking out current@ and replacing with ports@
 
 On 16 Jul 2011 16:38, "Stephen Montgomery-Smith" <stephen@missouri.edu>
 wrote:
 >
 > On 07/16/2011 04:26 AM, Stefan Bethke wrote:
 >>
 >> Am 16.07.2011 um 04:43 schrieb Stephen Montgomery-Smith:
 >>
 >>> I was looking through the source code of pkg_add.  Personally I don't
 see how the "-P" or "-p" option could be made to work with pkg_add. Many of
 the installation commands involve scripts which have ${PREFIX} hard coded
 into them.  ${PREFIX} is often hard coded when trhe package is created by
 the port.  In my opinion, the options "-p" and "-P" should be removed from
 pkg_add.
 >>>
 >>> Either that, or provide the port a way to access "@cwd" in any scripts
 it installs.  But this would require a major overhaul of the whole ports
 system, and probably much of the software it installs as well.
 >>>
 >>> Am I missing something?
 >>
 >>
 >> Yes.  Not honoring the prefix is a bug in the port.  If you do need to do
 prefix-specific things during install, use pkg-install, see
 http://www.freebsd.org/doc/en/books/porters-handbook/pkg-install.html
 >>
 >> I suspect that many ports are not well tested outside of "/usr/local",
 but the infrastructure is there and available.
 >
 >
 > You are correct, this needs to be done on a port by port basis.  In some
 ports this is going to be a big job, because in some cases the "/usr/local"
 is hard coded into certain binaries.
 >
 > For example, suppose the C source code contains something like:
 > char applications_dir = "/usr/local/share/applications";
 > and this is filled in by the ./configure script.
 >
 > How is that handled?
 >
 
 It's not.
 
 Remember what a package is, literally the files from the plist tarred with
 some magic +FILEs and the pkg-*install files- if paths are hardcoded in
 objects that's how it'll be installed.
 
 Don't touch the -p option! It's only useful for.... um.... someone help
 here?
 
 Chris
 
 --001636920d3a573ef904a831e0c0
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 <p>Taking out current@ and replacing with ports@<br></p>
 <p>On 16 Jul 2011 16:38, &quot;Stephen Montgomery-Smith&quot; &lt;<a href=
 =3D"mailto:stephen@missouri.edu">stephen@missouri.edu</a>&gt; wrote:<br>
 &gt;<br>
 &gt; On 07/16/2011 04:26 AM, Stefan Bethke wrote:<br>
 &gt;&gt;<br>
 &gt;&gt; Am 16.07.2011 um 04:43 schrieb Stephen Montgomery-Smith:<br>
 &gt;&gt;<br>
 &gt;&gt;&gt; I was looking through the source code of pkg_add. =A0Personall=
 y I don&#39;t see how the &quot;-P&quot; or &quot;-p&quot; option could be =
 made to work with pkg_add. Many of the installation commands involve script=
 s which have ${PREFIX} hard coded into them. =A0${PREFIX} is often hard cod=
 ed when trhe package is created by the port. =A0In my opinion, the options =
 &quot;-p&quot; and &quot;-P&quot; should be removed from pkg_add.<br>
 
 &gt;&gt;&gt;<br>
 &gt;&gt;&gt; Either that, or provide the port a way to access &quot;@cwd&qu=
 ot; in any scripts it installs. =A0But this would require a major overhaul =
 of the whole ports system, and probably much of the software it installs as=
  well.<br>
 
 &gt;&gt;&gt;<br>
 &gt;&gt;&gt; Am I missing something?<br>
 &gt;&gt;<br>
 &gt;&gt;<br>
 &gt;&gt; Yes. =A0Not honoring the prefix is a bug in the port. =A0If you do=
  need to do prefix-specific things during install, use pkg-install, see <a =
 href=3D"http://www.freebsd.org/doc/en/books/porters-handbook/pkg-install.ht=
 ml">http://www.freebsd.org/doc/en/books/porters-handbook/pkg-install.html</=
 a><br>
 
 &gt;&gt;<br>
 &gt;&gt; I suspect that many ports are not well tested outside of &quot;/us=
 r/local&quot;, but the infrastructure is there and available.<br>
 &gt;<br>
 &gt;<br>
 &gt; You are correct, this needs to be done on a port by port basis. =A0In =
 some ports this is going to be a big job, because in some cases the &quot;/=
 usr/local&quot; is hard coded into certain binaries.<br>
 &gt;<br>
 &gt; For example, suppose the C source code contains something like:<br>
 &gt; char applications_dir =3D &quot;/usr/local/share/applications&quot;;<b=
 r>
 &gt; and this is filled in by the ./configure script.<br>
 &gt;<br>
 &gt; How is that handled?<br>
 &gt;</p>
 <p>It&#39;s not.</p>
 <p>Remember what a package is, literally the files from the plist tarred wi=
 th some magic +FILEs and the pkg-*install files- if paths are hardcoded in =
 objects that&#39;s how it&#39;ll be installed.</p>
 <p>Don&#39;t touch the -p option! It&#39;s only useful for.... um.... someo=
 ne help here?</p>
 <p>Chris<br>
 </p>
 
 --001636920d3a573ef904a831e0c0--

From: Stephen Montgomery-Smith <stephen@missouri.edu>
To: Chris Rees <utisoft@gmail.com>
Cc: "current@freebsd.org" <current@FreeBSD.org>,
        "freebsd@sopwith.solgatos.com" <freebsd@sopwith.solgatos.com>,
        "bug-followup@freebsd.org" <bug-followup@FreeBSD.org>,
        Stefan Bethke <stb@lassitu.de>
Subject: Re: ports/158179: some packages do not fully honor -P dir option
 in pkg_add(1)
Date: Sat, 16 Jul 2011 11:04:48 -0500

 On 07/16/2011 10:53 AM, Chris Rees wrote:
 >
 > On 16 Jul 2011 16:38, "Stephen Montgomery-Smith" <stephen@missouri.edu
 > <mailto:stephen@missouri.edu>> wrote:
 >  >
 >  > On 07/16/2011 04:26 AM, Stefan Bethke wrote:
 >  >>
 >  >> Am 16.07.2011 um 04:43 schrieb Stephen Montgomery-Smith:
 >  >>
 >  >>> I was looking through the source code of pkg_add.  Personally I
 > don't see how the "-P" or "-p" option could be made to work with
 > pkg_add. Many of the installation commands involve scripts which have
 > ${PREFIX} hard coded into them.  ${PREFIX} is often hard coded when trhe
 > package is created by the port.  In my opinion, the options "-p" and
 > "-P" should be removed from pkg_add.
 >  >>>
 >  >>> Either that, or provide the port a way to access "@cwd" in any
 > scripts it installs.  But this would require a major overhaul of the
 > whole ports system, and probably much of the software it installs as well.
 >  >>>
 >  >>> Am I missing something?
 >  >>
 >  >>
 >  >> Yes.  Not honoring the prefix is a bug in the port.  If you do need
 > to do prefix-specific things during install, use pkg-install, see
 > http://www.freebsd.org/doc/en/books/porters-handbook/pkg-install.html
 >  >>
 >  >> I suspect that many ports are not well tested outside of
 > "/usr/local", but the infrastructure is there and available.
 >  >
 >  >
 >  > You are correct, this needs to be done on a port by port basis.  In
 > some ports this is going to be a big job, because in some cases the
 > "/usr/local" is hard coded into certain binaries.
 >  >
 >  > For example, suppose the C source code contains something like:
 >  > char applications_dir = "/usr/local/share/applications";
 >  > and this is filled in by the ./configure script.
 >  >
 >  > How is that handled?
 >  >
 >
 > It's not.
 >
 > Remember what a package is, literally the files from the plist tarred
 > with some magic +FILEs and the pkg-*install files- if paths are
 > hardcoded in objects that's how it'll be installed.
 
 What if some of the installation programs are binaries, and "/usr/local" 
 is hard coded into installation binaries or scripts provided by the 
 software itself.
 
 > Don't touch the -p option! It's only useful for.... um.... someone help
 > here?
 
 I am thinking the same thing!

From: Stephen Montgomery-Smith <stephen@missouri.edu>
To: Chris Rees <utisoft@gmail.com>
Cc: FreeBSD Ports <freebsd-ports@FreeBSD.org>,
        "freebsd@sopwith.solgatos.com" <freebsd@sopwith.solgatos.com>,
        "bug-followup@freebsd.org" <bug-followup@FreeBSD.org>,
        Stefan Bethke <stb@lassitu.de>
Subject: Re: ports/158179: some packages do not fully honor -P dir option
 in pkg_add(1)
Date: Sat, 16 Jul 2011 11:07:22 -0500

 Replacing current@ with ports@, just like Chris did.
 
 On 07/16/2011 10:53 AM, Chris Rees wrote:
 >
 > On 16 Jul 2011 16:38, "Stephen Montgomery-Smith" <stephen@missouri.edu
 > <mailto:stephen@missouri.edu>> wrote:
 >  >
 >  > On 07/16/2011 04:26 AM, Stefan Bethke wrote:
 >  >>
 >  >> Am 16.07.2011 um 04:43 schrieb Stephen Montgomery-Smith:
 >  >>
 >  >>> I was looking through the source code of pkg_add.  Personally I
 > don't see how the "-P" or "-p" option could be made to work with
 > pkg_add. Many of the installation commands involve scripts which have
 > ${PREFIX} hard coded into them.  ${PREFIX} is often hard coded when trhe
 > package is created by the port.  In my opinion, the options "-p" and
 > "-P" should be removed from pkg_add.
 >  >>>
 >  >>> Either that, or provide the port a way to access "@cwd" in any
 > scripts it installs.  But this would require a major overhaul of the
 > whole ports system, and probably much of the software it installs as well.
 >  >>>
 >  >>> Am I missing something?
 >  >>
 >  >>
 >  >> Yes.  Not honoring the prefix is a bug in the port.  If you do need
 > to do prefix-specific things during install, use pkg-install, see
 > http://www.freebsd.org/doc/en/books/porters-handbook/pkg-install.html
 >  >>
 >  >> I suspect that many ports are not well tested outside of
 > "/usr/local", but the infrastructure is there and available.
 >  >
 >  >
 >  > You are correct, this needs to be done on a port by port basis.  In
 > some ports this is going to be a big job, because in some cases the
 > "/usr/local" is hard coded into certain binaries.
 >  >
 >  > For example, suppose the C source code contains something like:
 >  > char applications_dir = "/usr/local/share/applications";
 >  > and this is filled in by the ./configure script.
 >  >
 >  > How is that handled?
 >  >
 >
 > It's not.
 >
 > Remember what a package is, literally the files from the plist tarred
 > with some magic +FILEs and the pkg-*install files- if paths are
 > hardcoded in objects that's how it'll be installed.
 
 What if some of the installation programs are binaries, and "/usr/local" 
 is hard coded into installation binaries or scripts provided by the 
 software itself.
 
 > Don't touch the -p option! It's only useful for.... um.... someone help
 > here?
 
 I am thinking the same thing!

From: Chris Rees <utisoft@gmail.com>
To: Stephen Montgomery-Smith <stephen@missouri.edu>
Cc: "freebsd@sopwith.solgatos.com" <freebsd@sopwith.solgatos.com>, 
	"current@freebsd.org" <current@freebsd.org>, "bug-followup@freebsd.org" <bug-followup@freebsd.org>, 
	Stefan Bethke <stb@lassitu.de>
Subject: Re: ports/158179: some packages do not fully honor -P dir option in pkg_add(1)
Date: Sat, 16 Jul 2011 17:10:56 +0100

 --00151748db10d7c5cd04a8320201
 Content-Type: text/plain; charset=ISO-8859-1
 
 On 16 Jul 2011 17:04, "Stephen Montgomery-Smith" <stephen@missouri.edu>
 wrote:
 >
 > On 07/16/2011 10:53 AM, Chris Rees wrote:
 >>
 >>
 >> On 16 Jul 2011 16:38, "Stephen Montgomery-Smith" <stephen@missouri.edu
 >> <mailto:stephen@missouri.edu>> wrote:
 >>  > For example, suppose the C source code contains something like:
 >>  > char applications_dir = "/usr/local/share/applications";
 >>  > and this is filled in by the ./configure script.
 >>  >
 >>  > How is that handled?
 >>  >
 >>
 >> It's not.
 >>
 >> Remember what a package is, literally the files from the plist tarred
 >> with some magic +FILEs and the pkg-*install files- if paths are
 >> hardcoded in objects that's how it'll be installed.
 >
 >
 > What if some of the installation programs are binaries, and "/usr/local"
 is hard coded into installation binaries or scripts provided by the software
 itself.
 
 Sorry, poor wording on my part.
 
 If it was compiled as prefix=/usr/local, that's how it'll be installed,
 regardless of your -p argument.
 
 Chris
 
 --00151748db10d7c5cd04a8320201
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 <p><br>
 On 16 Jul 2011 17:04, &quot;Stephen Montgomery-Smith&quot; &lt;<a href=3D"m=
 ailto:stephen@missouri.edu">stephen@missouri.edu</a>&gt; wrote:<br>
 &gt;<br>
 &gt; On 07/16/2011 10:53 AM, Chris Rees wrote:<br>
 &gt;&gt;<br>
 &gt;&gt;<br>
 &gt;&gt; On 16 Jul 2011 16:38, &quot;Stephen Montgomery-Smith&quot; &lt;<a =
 href=3D"mailto:stephen@missouri.edu">stephen@missouri.edu</a><br>
 &gt;&gt; &lt;mailto:<a href=3D"mailto:stephen@missouri.edu">stephen@missour=
 i.edu</a>&gt;&gt; wrote:<br>
 &gt;&gt; =A0&gt; For example, suppose the C source code contains something =
 like:<br>
 &gt;&gt; =A0&gt; char applications_dir =3D &quot;/usr/local/share/applicati=
 ons&quot;;<br>
 &gt;&gt; =A0&gt; and this is filled in by the ./configure script.<br>
 &gt;&gt; =A0&gt;<br>
 &gt;&gt; =A0&gt; How is that handled?<br>
 &gt;&gt; =A0&gt;<br>
 &gt;&gt;<br>
 &gt;&gt; It&#39;s not.<br>
 &gt;&gt;<br>
 &gt;&gt; Remember what a package is, literally the files from the plist tar=
 red<br>
 &gt;&gt; with some magic +FILEs and the pkg-*install files- if paths are<br=
 >
 &gt;&gt; hardcoded in objects that&#39;s how it&#39;ll be installed.<br>
 &gt;<br>
 &gt;<br>
 &gt; What if some of the installation programs are binaries, and &quot;/usr=
 /local&quot; is hard coded into installation binaries or scripts provided b=
 y the software itself.<br></p>
 <p>Sorry, poor wording on my part.</p>
 <p>If it was compiled as prefix=3D/usr/local, that&#39;s how it&#39;ll be i=
 nstalled, regardless of your -p argument.</p>
 <p>Chris</p>
 
 --00151748db10d7c5cd04a8320201--

From: Chris Rees <crees@freebsd.org>
To: "bug-followup@freebsd.org" <bug-followup@freebsd.org>, "current@freebsd.org" <current@freebsd.org>, 
	"freebsd@sopwith.solgatos.com" <freebsd@sopwith.solgatos.com>, Stefan Bethke <stb@lassitu.de>, 
	Stephen Montgomery-Smith <stephen@freebsd.org>
Cc:  
Subject: Re: ports/158179: some packages do not fully honor -P dir option in pkg_add(1)
Date: Sat, 16 Jul 2011 17:13:12 +0100

 --bcaec5431e90ee473804a8320a3b
 Content-Type: text/plain; charset=ISO-8859-1
 
 On 16 Jul 2011 17:04, "Stephen Montgomery-Smith" <stephen@missouri.edu>
 wrote:
 >
 > On 07/16/2011 10:53 AM, Chris Rees wrote:
 >>
 >>
 >> On 16 Jul 2011 16:38, "Stephen Montgomery-Smith" <stephen@missouri.edu
 >> <mailto:stephen@missouri.edu>> wrote:
 >>  > For example, suppose the C source code contains something like:
 >>  > char applications_dir = "/usr/local/share/applications";
 >>  > and this is filled in by the ./configure script.
 >>  >
 >>  > How is that handled?
 >>  >
 >>
 >> It's not.
 >>
 >> Remember what a package is, literally the files from the plist tarred
 >> with some magic +FILEs and the pkg-*install files- if paths are
 >> hardcoded in objects that's how it'll be installed.
 >
 >
 > What if some of the installation programs are binaries, and "/usr/local"
 is hard coded into installation binaries or scripts provided by the software
 itself.
 
 Sorry, poor wording on my part.
 
 If it was compiled as prefix=/usr/local, that's how it'll be installed,
 regardless of your -p argument.
 
 Chris
 
 --bcaec5431e90ee473804a8320a3b
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 <p><br>
 On 16 Jul 2011 17:04, &quot;Stephen Montgomery-Smith&quot; &lt;<a href=3D"m=
 ailto:stephen@missouri.edu">stephen@missouri.edu</a>&gt; wrote:<br>
 &gt;<br>
 &gt; On 07/16/2011 10:53 AM, Chris Rees wrote:<br>
 &gt;&gt;<br>
 &gt;&gt;<br>
 &gt;&gt; On 16 Jul 2011 16:38, &quot;Stephen Montgomery-Smith&quot; &lt;<a =
 href=3D"mailto:stephen@missouri.edu">stephen@missouri.edu</a><br>
 &gt;&gt; &lt;mailto:<a href=3D"mailto:stephen@missouri.edu">stephen@missour=
 i.edu</a>&gt;&gt; wrote:<br>
 &gt;&gt; =A0&gt; For example, suppose the C source code contains something =
 like:<br>
 &gt;&gt; =A0&gt; char applications_dir =3D &quot;/usr/local/share/applicati=
 ons&quot;;<br>
 &gt;&gt; =A0&gt; and this is filled in by the ./configure script.<br>
 &gt;&gt; =A0&gt;<br>
 &gt;&gt; =A0&gt; How is that handled?<br>
 &gt;&gt; =A0&gt;<br>
 &gt;&gt;<br>
 &gt;&gt; It&#39;s not.<br>
 &gt;&gt;<br>
 &gt;&gt; Remember what a package is, literally the files from the plist tar=
 red<br>
 &gt;&gt; with some magic +FILEs and the pkg-*install files- if paths are<br=
 >
 &gt;&gt; hardcoded in objects that&#39;s how it&#39;ll be installed.<br>
 &gt;<br>
 &gt;<br>
 &gt; What if some of the installation programs are binaries, and &quot;/usr=
 /local&quot; is hard coded into installation binaries or scripts provided b=
 y the software itself.</p>
 <p>Sorry, poor wording on my part.</p>
 <p>If it was compiled as prefix=3D/usr/local, that&#39;s how it&#39;ll be i=
 nstalled, regardless of your -p argument.</p>
 <p>Chris</p>
 
 --bcaec5431e90ee473804a8320a3b--

From: Stephen Montgomery-Smith <stephen@missouri.edu>
To: Chris Rees <utisoft@gmail.com>
Cc: "freebsd@sopwith.solgatos.com" <freebsd@sopwith.solgatos.com>,
        FreeBSD Ports <freebsd-ports@FreeBSD.org>,
        "bug-followup@freebsd.org" <bug-followup@FreeBSD.org>,
        Stefan Bethke <stb@lassitu.de>
Subject: Re: ports/158179: some packages do not fully honor -P dir option
 in pkg_add(1)
Date: Sat, 16 Jul 2011 11:18:09 -0500

 current@ to ports@ again.  (Sorry, my mistake.)
 
 On 07/16/2011 11:10 AM, Chris Rees wrote:
 >
 > On 16 Jul 2011 17:04, "Stephen Montgomery-Smith" <stephen@missouri.edu
 > <mailto:stephen@missouri.edu>> wrote:
 >  >
 >  > On 07/16/2011 10:53 AM, Chris Rees wrote:
 >  >>
 >  >>
 >  >> On 16 Jul 2011 16:38, "Stephen Montgomery-Smith"
 > <stephen@missouri.edu <mailto:stephen@missouri.edu>
 >  >> <mailto:stephen@missouri.edu <mailto:stephen@missouri.edu>>> wrote:
 >  >> > For example, suppose the C source code contains something like:
 >  >> > char applications_dir = "/usr/local/share/applications";
 >  >> > and this is filled in by the ./configure script.
 >  >> >
 >  >> > How is that handled?
 >  >> >
 >  >>
 >  >> It's not.
 >  >>
 >  >> Remember what a package is, literally the files from the plist tarred
 >  >> with some magic +FILEs and the pkg-*install files- if paths are
 >  >> hardcoded in objects that's how it'll be installed.
 >  >
 >  >
 >  > What if some of the installation programs are binaries, and
 > "/usr/local" is hard coded into installation binaries or scripts
 > provided by the software itself.
 >
 > Sorry, poor wording on my part.
 
 No, I didn't read what you said properly.
 
 > If it was compiled as prefix=/usr/local, that's how it'll be installed,
 > regardless of your -p argument.
 
 So "-p" and "-P" are inherently buggy, and should be removed from pkg_add?
 
 (Or every port which uses prefix=/usr/local needs major revision and 
 patching, which I think is an intolerable workload.)

From: Chris Rees <crees@freebsd.org>
To: Stephen Montgomery-Smith <stephen@missouri.edu>
Cc: "freebsd@sopwith.solgatos.com" <freebsd@sopwith.solgatos.com>, 
	"bug-followup@freebsd.org" <bug-followup@freebsd.org>, Stefan Bethke <stb@lassitu.de>, 
	FreeBSD Ports <freebsd-ports@freebsd.org>
Subject: Re: ports/158179: some packages do not fully honor -P dir option in pkg_add(1)
Date: Sat, 16 Jul 2011 17:21:12 +0100

 --bcaec5431e908ca63204a832274a
 Content-Type: text/plain; charset=ISO-8859-1
 
 On 16 Jul 2011 17:18, "Stephen Montgomery-Smith" <stephen@missouri.edu>
 wrote:
 >
 > current@ to ports@ again.  (Sorry, my mistake.)
 >
 >
 > On 07/16/2011 11:10 AM, Chris Rees wrote:
 >>
 >>
 >> On 16 Jul 2011 17:04, "Stephen Montgomery-Smith" <stephen@missouri.edu
 >> <mailto:stephen@missouri.edu>> wrote:
 >>  >
 >>  > On 07/16/2011 10:53 AM, Chris Rees wrote:
 >>  >>
 >>  >>
 >>  >> On 16 Jul 2011 16:38, "Stephen Montgomery-Smith"
 >> <stephen@missouri.edu <mailto:stephen@missouri.edu>
 >>  >> <mailto:stephen@missouri.edu <mailto:stephen@missouri.edu>>> wrote:
 >>  >> > For example, suppose the C source code contains something like:
 >>  >> > char applications_dir = "/usr/local/share/applications";
 >>  >> > and this is filled in by the ./configure script.
 >>  >> >
 >>  >> > How is that handled?
 >>  >> >
 >>  >>
 >>  >> It's not.
 >>  >>
 >>  >> Remember what a package is, literally the files from the plist tarred
 >>  >> with some magic +FILEs and the pkg-*install files- if paths are
 >>  >> hardcoded in objects that's how it'll be installed.
 >>  >
 >>  >
 >>  > What if some of the installation programs are binaries, and
 >> "/usr/local" is hard coded into installation binaries or scripts
 >> provided by the software itself.
 >>
 >> Sorry, poor wording on my part.
 >
 >
 > No, I didn't read what you said properly.
 >
 >
 >> If it was compiled as prefix=/usr/local, that's how it'll be installed,
 >> regardless of your -p argument.
 >
 >
 > So "-p" and "-P" are inherently buggy, and should be removed from pkg_add?
 >
 > (Or every port which uses prefix=/usr/local needs major revision and
 patching, which I think is an intolerable workload.)
 
 They are only for internal and experimental use really anyway. Perhaps the
 manpage should mention that.
 
 Bear in mind they should work fine if the port doesn't hardcode absolute
 paths.
 
 Chris
 
 --bcaec5431e908ca63204a832274a
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 <p><br>
 On 16 Jul 2011 17:18, &quot;Stephen Montgomery-Smith&quot; &lt;<a href=3D"m=
 ailto:stephen@missouri.edu">stephen@missouri.edu</a>&gt; wrote:<br>
 &gt;<br>
 &gt; current@ to ports@ again. =A0(Sorry, my mistake.)<br>
 &gt;<br>
 &gt;<br>
 &gt; On 07/16/2011 11:10 AM, Chris Rees wrote:<br>
 &gt;&gt;<br>
 &gt;&gt;<br>
 &gt;&gt; On 16 Jul 2011 17:04, &quot;Stephen Montgomery-Smith&quot; &lt;<a =
 href=3D"mailto:stephen@missouri.edu">stephen@missouri.edu</a><br>
 &gt;&gt; &lt;mailto:<a href=3D"mailto:stephen@missouri.edu">stephen@missour=
 i.edu</a>&gt;&gt; wrote:<br>
 &gt;&gt; =A0&gt;<br>
 &gt;&gt; =A0&gt; On 07/16/2011 10:53 AM, Chris Rees wrote:<br>
 &gt;&gt; =A0&gt;&gt;<br>
 &gt;&gt; =A0&gt;&gt;<br>
 &gt;&gt; =A0&gt;&gt; On 16 Jul 2011 16:38, &quot;Stephen Montgomery-Smith&q=
 uot;<br>
 &gt;&gt; &lt;<a href=3D"mailto:stephen@missouri.edu">stephen@missouri.edu</=
 a> &lt;mailto:<a href=3D"mailto:stephen@missouri.edu">stephen@missouri.edu<=
 /a>&gt;<br>
 &gt;&gt; =A0&gt;&gt; &lt;mailto:<a href=3D"mailto:stephen@missouri.edu">ste=
 phen@missouri.edu</a> &lt;mailto:<a href=3D"mailto:stephen@missouri.edu">st=
 ephen@missouri.edu</a>&gt;&gt;&gt; wrote:<br>
 &gt;&gt; =A0&gt;&gt; &gt; For example, suppose the C source code contains s=
 omething like:<br>
 &gt;&gt; =A0&gt;&gt; &gt; char applications_dir =3D &quot;/usr/local/share/=
 applications&quot;;<br>
 &gt;&gt; =A0&gt;&gt; &gt; and this is filled in by the ./configure script.<=
 br>
 &gt;&gt; =A0&gt;&gt; &gt;<br>
 &gt;&gt; =A0&gt;&gt; &gt; How is that handled?<br>
 &gt;&gt; =A0&gt;&gt; &gt;<br>
 &gt;&gt; =A0&gt;&gt;<br>
 &gt;&gt; =A0&gt;&gt; It&#39;s not.<br>
 &gt;&gt; =A0&gt;&gt;<br>
 &gt;&gt; =A0&gt;&gt; Remember what a package is, literally the files from t=
 he plist tarred<br>
 &gt;&gt; =A0&gt;&gt; with some magic +FILEs and the pkg-*install files- if =
 paths are<br>
 &gt;&gt; =A0&gt;&gt; hardcoded in objects that&#39;s how it&#39;ll be insta=
 lled.<br>
 &gt;&gt; =A0&gt;<br>
 &gt;&gt; =A0&gt;<br>
 &gt;&gt; =A0&gt; What if some of the installation programs are binaries, an=
 d<br>
 &gt;&gt; &quot;/usr/local&quot; is hard coded into installation binaries or=
  scripts<br>
 &gt;&gt; provided by the software itself.<br>
 &gt;&gt;<br>
 &gt;&gt; Sorry, poor wording on my part.<br>
 &gt;<br>
 &gt;<br>
 &gt; No, I didn&#39;t read what you said properly.<br>
 &gt;<br>
 &gt;<br>
 &gt;&gt; If it was compiled as prefix=3D/usr/local, that&#39;s how it&#39;l=
 l be installed,<br>
 &gt;&gt; regardless of your -p argument.<br>
 &gt;<br>
 &gt;<br>
 &gt; So &quot;-p&quot; and &quot;-P&quot; are inherently buggy, and should =
 be removed from pkg_add?<br>
 &gt;<br>
 &gt; (Or every port which uses prefix=3D/usr/local needs major revision and=
  patching, which I think is an intolerable workload.)</p>
 <p>They are only for internal and experimental use really anyway. Perhaps t=
 he manpage should mention that.</p>
 <p>Bear in mind they should work fine if the port doesn&#39;t hardcode abso=
 lute paths.</p>
 <p>Chris</p>
 
 --bcaec5431e908ca63204a832274a--

From: Adrian Chadd <adrian@freebsd.org>
To: Chris Rees <crees@freebsd.org>
Cc: "bug-followup@freebsd.org" <bug-followup@freebsd.org>, "current@freebsd.org" <current@freebsd.org>, 
	"freebsd@sopwith.solgatos.com" <freebsd@sopwith.solgatos.com>, Stefan Bethke <stb@lassitu.de>, 
	Stephen Montgomery-Smith <stephen@freebsd.org>
Subject: Re: ports/158179: some packages do not fully honor -P dir option in pkg_add(1)
Date: Sun, 17 Jul 2011 10:02:38 +0800

 Unless say, you're doing package installation outside of a
 chroot/jail, to populate something inside a chroot/jail before you
 start said chroot/jail.
 
 
 
 Adrian
 
 On 17 July 2011 00:13, Chris Rees <crees@freebsd.org> wrote:
 > On 16 Jul 2011 17:04, "Stephen Montgomery-Smith" <stephen@missouri.edu>
 > wrote:
 >>
 >> On 07/16/2011 10:53 AM, Chris Rees wrote:
 >>>
 >>>
 >>> On 16 Jul 2011 16:38, "Stephen Montgomery-Smith" <stephen@missouri.edu
 >>> <mailto:stephen@missouri.edu>> wrote:
 >>> =A0> For example, suppose the C source code contains something like:
 >>> =A0> char applications_dir =3D "/usr/local/share/applications";
 >>> =A0> and this is filled in by the ./configure script.
 >>> =A0>
 >>> =A0> How is that handled?
 >>> =A0>
 >>>
 >>> It's not.
 >>>
 >>> Remember what a package is, literally the files from the plist tarred
 >>> with some magic +FILEs and the pkg-*install files- if paths are
 >>> hardcoded in objects that's how it'll be installed.
 >>
 >>
 >> What if some of the installation programs are binaries, and "/usr/local"
 > is hard coded into installation binaries or scripts provided by the softw=
 are
 > itself.
 >
 > Sorry, poor wording on my part.
 >
 > If it was compiled as prefix=3D/usr/local, that's how it'll be installed,
 > regardless of your -p argument.
 >
 > Chris
 > _______________________________________________
 > freebsd-current@freebsd.org mailing list
 > http://lists.freebsd.org/mailman/listinfo/freebsd-current
 > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org=
 "
 >

From: Stephen Montgomery-Smith <stephen@missouri.edu>
To: Adrian Chadd <adrian@freebsd.org>
Cc: Chris Rees <crees@freebsd.org>,
        "freebsd@sopwith.solgatos.com" <freebsd@sopwith.solgatos.com>,
        Stephen Montgomery-Smith <stephen@freebsd.org>,
        FreeBSD Ports <freebsd-ports@freebsd.org>,
        "bug-followup@freebsd.org" <bug-followup@freebsd.org>,
        Stefan Bethke <stb@lassitu.de>
Subject: Re: ports/158179: some packages do not fully honor -P dir option
 in	pkg_add(1)
Date: Sun, 17 Jul 2011 10:12:07 -0500

 current -> ports
 
 On 07/16/2011 09:02 PM, Adrian Chadd wrote:
 > Unless say, you're doing package installation outside of a
 > chroot/jail, to populate something inside a chroot/jail before you
 > start said chroot/jail.
 >
 
 I can see "-P" and "-p" working for those many ports which just put 
 programs in place.  But there are some ports that include installation 
 programs as part of the software.  And some ports (like octave) which 
 have a program which sometimes acts as an installation script, and 
 sometimes acts as a user program.  And sometimes those installation 
 programs install for the port, and sometimes they install for a subport.
 
 If we are to continue using the "-P" and "-p" options, I suggest someone 
 does the following:
 
 1.  Spell out very clearly its purpose - is it to populate a jail, for 
 example?
 
 2.  Set up a computer that tests each package to see if it is "-P" 
 compliant and "-p" compliant.  By the way, each should be tested 
 separately.  For example, suppose latex-pgf is installed with the "-p" 
 option.  Then does it expect mktexlsr to be in the directory it is 
 installing into, or the regular directory?  mktexlsr is installed by a 
 dependency, so the package needs to know where to find it.  It would 
 seem to me that you need a PKG_LOCALBASE variable as well as a 
 PKG_PREFIX variable, so that the port knows where to find these 
 installation programs.
 
 3.  Add a flag to ports that allow the port maintainer to mark the port 
 "-p" non-compliant and "-P" non-compliant.
 
 The other possibility is to add to the man page of pkg_add saying that 
 there is a good chance the "-p" and "-P" options don't work properly. 
 Some people have clearly indicated that they like and use these options, 
 so let's keep them happy too, and not delete it altogether.
 
 Stephen

From: "Dieter BSD" <dieterbsd@engineer.com>
To: bug-followup@freebsd.org
Cc: FreeBSD Ports
 <freebsd-ports@freebsd.org>,freebsd@sopwith.solgatos.com,freebsd@fokker.solgatos.com
Subject: Re: ports/158179: some packages do not fully honor -P dir option in
 pkg_add(1)
Date: Tue, 19 Jul 2011 18:41:31 +0000

 > 1.  Spell out very clearly its purpose - is it to populate a jail, for
 > example?
 
 Populating a chroot/jail is one purpose.
 
 Another is to test a new version of a package without messing up the
 existing version.
 
 There are bound to be other reasons.
 
 Compiling the port rather than installing a package isn't always
 a solution.  Many ports are incredibly difficult to get compiled.
 
 PREFIX needs to be an install time variable, not compile time.

From: Stephen Montgomery-Smith <stephen@missouri.edu>
To: Dieter BSD <dieterbsd@engineer.com>
Cc: "bug-followup@freebsd.org" <bug-followup@freebsd.org>,
        "freebsd@sopwith.solgatos.com" <freebsd@sopwith.solgatos.com>,
        "freebsd@fokker.solgatos.com" <freebsd@fokker.solgatos.com>,
        FreeBSD Ports <freebsd-ports@freebsd.org>
Subject: Re: ports/158179: some packages do not fully honor -P dir option
 in pkg_add(1)
Date: Tue, 19 Jul 2011 13:56:28 -0500

 On 07/19/2011 01:41 PM, Dieter BSD wrote:
 >> 1.  Spell out very clearly its purpose - is it to populate a jail, for
 >> example?
 >
 > Populating a chroot/jail is one purpose.
 >
 > Another is to test a new version of a package without messing up the
 > existing version.
 
 I don't see how these two goals are compatible.  Any programs installed 
 for the purpose of a chroot/jail will have to point to $PREFIX, whereas 
 any programs installed for the purpose of testing it elsewhere will 
 either have to point to $PREFIX (if the stuff it is pointing to was not 
 installed by the current package and the "-p" option was invoked), or to 
 $PKG_PREFIX (if the stuff it is pointing to was installed by the current 
 package or the "-P" option was invoked).
 

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...?
State-Changed-From-To: open->closed 
State-Changed-By: crees 
State-Changed-When: Thu Nov 3 21:14:21 UTC 2011 
State-Changed-Why:  
Please let's continue this on ports@ if necessary. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=158179 
>Unformatted:
