From owner-freebsd-ports@FreeBSD.ORG Mon Jul 23 22:13:55 2007 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 3C1CB16A418 for ; Mon, 23 Jul 2007 22:13:55 +0000 (UTC) (envelope-from pauls@utdallas.edu) Received: from smtp3.utdallas.edu (smtp3.utdallas.edu [129.110.10.49]) by mx1.freebsd.org (Postfix) with ESMTP id 18CC013C461 for ; Mon, 23 Jul 2007 22:13:54 +0000 (UTC) (envelope-from pauls@utdallas.edu) Received: from utd59514.utdallas.edu (utd59514.utdallas.edu [129.110.3.28]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp3.utdallas.edu (Postfix) with ESMTP id 40D4C654F2 for ; Mon, 23 Jul 2007 17:13:54 -0500 (CDT) Date: Mon, 23 Jul 2007 17:13:50 -0500 From: Paul Schmehl To: FreeBSD Ports Message-ID: X-Mailer: Mulberry/4.0.6 (Linux/x86) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=sha1; protocol="application/pkcs7-signature"; boundary="==========3FEBB1A754A960CEECE7==========" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: How to include new dirs in @INC 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: Mon, 23 Jul 2007 22:13:55 -0000 --==========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==========--