Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Jul 2009 12:35:01 +0200
From:      Cezary Morga <cm@therek.net>
To:        Matthew Seaman <m.seaman@infracaninophile.co.uk>
Cc:        QAT@freebsd.org, freebsd ports <freebsd-ports@freebsd.org>
Subject:   Re: [Custom LOCALBASE/PREFIX] www/p5-RT-Extension-SLA - fails: mtree
Message-ID:  <4A5C5F55.4090204@therek.net>
In-Reply-To: <4A5C4E73.9000901@infracaninophile.co.uk>
References:  <20090706181739.D2DB28FCB7@release.ixsystems.com> <4A5363AA.8030407@infracaninophile.co.uk> <4A5B97D7.2070708@therek.net> <4A5C4E73.9000901@infracaninophile.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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