[Custom LOCALBASE/PREFIX] www/p5-RT-Extension-SLA - fails: mtree

Cezary Morga cm at therek.net
Tue Jul 14 10:35:13 UTC 2009


Matthew Seaman pisze:
> I think that your patch essentially does that, but see ports/136656 where
> I have a simpler solution -- just remove $PREFIX from the environment
> during configuration.

I don't think removing PREFIX is a good idea. FreeBSD is supposed to 
support PREFIX for users wishing to install ports elsewhere than 
/usr/local, that's what this QAT tests 'Custom LOCALBASE/PREFIX' are about.

The problem with inc/Module/Install/RTx.pm from www/p5-RT-Extension-SLA 
is that it assumes that PREFIX is always correct:

     my @prefixes = (qw(/opt /usr/local /home /usr /sw ));
     my $prefix   = $ENV{PREFIX};
     <...>
     if ($prefix) {
          $RT::LocalPath = $prefix;
          $INC{'RT.pm'} = "$RT::LocalPath/lib/RT.pm";
     } else {

and does not even try loading the module, as

     ( eval { require RT; $RT::LocalPath } )

is located in else{}. Then it goes to using $RT variables

     my $local_lib_path = "$RT::LocalPath/lib";
     <...>
     $RT::LocalVarPath  ||= $RT::VarPath;
     $RT::LocalPoPath   ||= $RT::LocalLexiconPath;
     $RT::LocalHtmlPath ||= $RT::MasonComponentRoot;
     $RT::LocalLibPath  ||= "$RT::LocalPath/lib";

which are not set.

Removing PREFIX will skip if ($prefix) {} part and trigger else{} but 
with RT.pm installed elsewhere than locations listed in @prefixes it 
will still fail.

Not to mention the different meanings of environment variable PREFIX 
from FreeBSD ports and RT points of view. For RT PREFIX==LOCALBASE, 
which might not be true in FreeBSD world.

If you really want to fiddle with environment settings, I'd suggest no 
to remove PREFIX from the environment, but set it to RTHOME (if RTHOME 
honors LOCALBASE/PREFIX).

The problem with LOCALBASE!=PREFIX will remain unsolved either way.

-- 
Cezary Morga


More information about the freebsd-ports mailing list