perl5.8 fixup

Marcus Calhoun-Lopez mcalhoun at macports.org
Thu Mar 5 17:53:39 PST 2009


Eric Hall <opendarwin.org at ...> writes:
> 
> 	I think removing perl module ports that *currently* conflict
> with and match modules installed by the perl5 port is a bad idea.
> In particular, until perl5.8 @5.8.9, there were several perl modules
> installed by perl5.8 (@5.8.8 here, File::Temp for example) that were 
> too old for some other modules and/or perl-based code/ports.  Thus
> a newer version of the module needed to be installed in order for 
> the higher-level ports to function.  I fully expect this problem will
> occur again, and we need to be able to solve it.
> 
> 	One of the ways is to invert the @INC tree (ala FreeBSD
> ports) so that macports installed perl modules (from p5-*) are found
> before the base perl modules (from the perl5.x port), thus the
> ports don't have to be set to overwrite the installed perl modules.
> 
> 	The other problem is what to do with the man pages.  This is
> a fairly recent problem (appeared around the time perl5.8 went to
> perl 5.8.9).  I haven't come up with a satisfactory solution for this
> yet, the primary problem being that when a user types, for example,
> 'man CGI', how do we ensure that they get the "right" CGI man page?
> How do we ensure they get a mac-ports installed man page when they have
> perl5.8 installed, but not the p5-cgi port?  And if they have both
> perl5.8 and p5-cgi, which man page should they get when they type
> 'man CGI'?
> 
> 	Overall I agree there is a problem with the way that
> perl (at least perl5.8) and modules (p5-*) currently interact, and
> we need a good (great? sufficient?) solution for the problem.
> 

What about the following:
    * Do not overwrite any perl modules (no more -f)
           and have the perl5.8 modules found first (don't invert @INC).
    * If the module supplied by perl is sufficient, do not add it as a dependency.
    * If  a newer version of the module is needed, patch the port
              use xxx; ->   use lib 'dir_location';
                                      use xxx;
                                      @INC = @lib::ORIG_INC;
       lib prepends dir_location to INC (see http://perldoc.perl.org/lib.html).
    * Append the version number to the man pages of conflicting p5-* ports
           so they no longer conflict.
       They will not be found by default, but neither will the perl modules.

This assumes the number of ports which actually need the newer version
is relatively small, so there would not be much patching involved.

The advantages:
   - No more -f
   - Since @INC is not modified, invoking ${prefix}/bin/perl will be the same
          no matter if a newer p5-* port is installed or not.

-Marcus



More information about the macports-dev mailing list