Date: Mon, 23 Jul 2007 17:13:50 -0500 From: Paul Schmehl <pauls@utdallas.edu> To: FreeBSD Ports <freebsd-ports@freebsd.org> Subject: Re: How to include new dirs in @INC Message-ID: <A28004F61E056F5279E996F7@utd59514.utdallas.edu>
next in thread | raw e-mail | index | archive | help
--==========3FEBB1A754A960CEECE7========== Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Somehow I missed Anton's response, so I'm copying it here so I can respond=20 as well. >On Sun, Jul 22, 2007 at 11:08:44PM -0500, Paul Schmehl wrote: >> I'm working on a port upgrade, and I'm copying some perl modules to >> %%SITE_PERL%%/mach/newdir. Unfortunately, the scripts won't run because >> the perl modules aren't included in @INC. How do I update @INC to=20 include >> the new path? (I have USE_PERL=3D yes in the Makefile.) Is there a=20 script >> I have to run? Is there an ldconfig for perl? > In theory, one might set environment variable PERLLIB or PERL5LIB. This > won't work for scripts that run with euid and ruid that differ. > Alternatively, the scripts using the modules in a non-standard location=20 must > be modified to "use lib qw(/path)", which modifies @INC. I can certainly do that, by patching the scripts. > Alternatively, Perl itself needs to be recompiled with new paths. Probably a bad choice for a port. :-) > Alternatively, you need to figure out whether you can place the modules=20 into > a standard location. It looks like you are trying to do that, but = clearly > you are doing something wrong. What are the names of the modules and=20 their > packages? Here's the hierarchy: ls -lsa /usr/local/lib/perl5/site_perl/5.8.8/mach/Bro/ total 64 2 drwxr-xr-x 4 root wheel 512 Jul 22 22:51 . 6 drwxr-xr-x 26 root wheel 4608 Jul 22 22:51 .. 4 -r--r--r-- 1 root wheel 3601 Jul 22 22:51 IP4.pm 2 drwxr-xr-x 2 root wheel 512 Jul 22 22:51 Log 8 -r--r--r-- 1 root wheel 6851 Jul 22 22:51 Log.pm 2 drwxr-xr-x 2 root wheel 512 Jul 22 22:51 Report 12 -r--r--r-- 1 root wheel 11945 Jul 22 22:51 Report.pm 28 -r--r--r-- 1 root wheel 26767 Jul 22 22:51 Signature.pm ls -lsa /usr/local/lib/perl5/site_perl/5.8.8/mach/Bro/Log/ total 30 2 drwxr-xr-x 2 root wheel 512 Jul 22 22:51 . 2 drwxr-xr-x 4 root wheel 512 Jul 22 22:51 .. 12 -r--r--r-- 1 root wheel 11968 Jul 22 22:51 Alarm.pm 14 -r--r--r-- 1 root wheel 13654 Jul 22 22:51 Conn.pm ls -lsa /usr/local/lib/perl5/site_perl/5.8.8/mach/Bro/Report/ total 78 2 drwxr-xr-x 2 root wheel 512 Jul 22 22:51 . 2 drwxr-xr-x 4 root wheel 512 Jul 22 22:51 .. 54 -r--r--r-- 1 root wheel 53742 Jul 22 22:51 Alarm.pm 20 -r--r--r-- 1 root wheel 18481 Jul 22 22:51 Conn.pm And yes, the two subdirs contained identically named modules but they are=20 different. (IOW, the code is not identical.) After checking the scripts, all of them refer to Bro::Module except one.=20 So I can put that one module (IP4.pm) in /mach and solve the problem that=20 way. The others appear to be correctly coded. --=20 Paul Schmehl (pauls@utdallas.edu) Senior Information Security Analyst The University of Texas at Dallas http://www.utdallas.edu/ir/security/ --==========3FEBB1A754A960CEECE7==========--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A28004F61E056F5279E996F7>