Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jul 2007 10:17:53 -0500
From:      Paul Schmehl <pauls@utdallas.edu>
To:        Anton Berezin <tobez@tobez.org>
Cc:        FreeBSD Ports <freebsd-ports@freebsd.org>
Subject:   Re: How to include new dirs in @INC
Message-ID:  <69DD0E3AC68E2AEC7C876B4C@utd59514.utdallas.edu>
In-Reply-To: <20070724142514.GA4315@heechee.tobez.org>
References:  <A28004F61E056F5279E996F7@utd59514.utdallas.edu> <20070724095718.GB68140@heechee.tobez.org> <1B50EA71ECD75693D12CE9D3@utd59514.utdallas.edu> <20070724142514.GA4315@heechee.tobez.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--==========108284049967D9387914==========
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

--On Tuesday, July 24, 2007 16:25:14 +0200 Anton Berezin <tobez@tobez.org>=20
wrote:

> On Tue, Jul 24, 2007 at 09:18:17AM -0500, Paul Schmehl wrote:
>
>> BTW, maybe you know the answer to this.  I can't remove the perl modules
>> in  pkg-plist because it prepends PREFIX to SITE_PERL, making the
>> location  /usr/local/usr/local/lib/perl5/site_perl/5.8.8.  This seems to
>> me to be a  bug.  Shouldn't pkg-plist honor SITE_PERL and not prepend
>> PREFIX?
>
> Hmmm.  I assume you are using %%SITE_PERL%% as the prefix in the
> pkg-plist?
>
Yes, that's correct.

> bsd.port.mk defines ${SITE_PERL} as ${PREFIX}${SITE_PERL_REL}, and it
> defines a plist substitution %%SITE_PERL%% to be the same as
> ${SITE_PERL_REL}, so in most circumstances it "just works".
>
I tried both %%SITE_PERL%% and %%SITE_PERL_REL%% and both failed.

> Maybe a snippet of your pkg-plist together with *-install Makefile =
targets
> (if any) would help to see what's wrong?
>
The %%SITE_PERL%% stuff is no longer in pkg-plist.  I moved it to the=20
pkg-deinstall script.  I could do some more testing, I suppose.....

OK, commented out one of the modules in the pkg-deinstall script and added=20
it to pkg-plist like this:
%%SITE_PERL%%/mach/IP4.pm

Then I installed the port and confirmed that the module was installed:
ls /usr/local/lib/perl5/site_perl/5.8.8/mach/IP4.pm
/usr/local/lib/perl5/site_perl/5.8.8/mach/IP4.pm

Then I deinstalled the port and got this error:
make deinstall PREFIX=3D/var/tmp/$(make -V PORTNAME)
=3D=3D=3D>  Deinstalling for security/bro
=3D=3D=3D>   Deinstalling bro-1.2
pkg_delete: file '/var/tmp/bro/lib/perl5/site_perl/5.8.8/mach/IP4.pm'=20
doesn't exist
pkg_delete: couldn't entirely delete package (perhaps the packing list is
incorrectly specified?)

As you can see, SITE_PERL is prepending PREFIX to SITE_PERL_REL (as you=20
said), but perl modules are *always* installed in=20
/usr/local/lib/perl5/site_perl/blah, are they not?

IOW, this will work fine in pkg-plist *if* (and only if) PREFIX is the=20
default.  If the installer changes PREFIX to anything else, the perl=20
modules will not be uninstalled and the deinstall will generate an error.=20
(Installing the perl modules in non-standard-PREFIX/lib/blah makes no sense =

because the scripts won't work because @INC doesn't include non-standard=20
locations by default.)

Perhaps the correct way to resolve this is to change bsd.port.mk to define=20
${SITE_PERL} in pkg-plist as ${LOCALBASE}/${SITE_PERL_REL} instead of=20
${PREFIX}/${SITE_PERL_REL}?  No matter what PREFIX an installer chooses,=20
perl modules should always be in LOCALBASE, right?

--=20
Paul Schmehl (pauls@utdallas.edu)
Senior Information Security Analyst
The University of Texas at Dallas
http://www.utdallas.edu/ir/security/

--==========108284049967D9387914==========--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69DD0E3AC68E2AEC7C876B4C>