perl5.8 fixup

Eric Hall opendarwin.org at darkart.com
Fri Mar 13 09:41:15 PDT 2009


On Fri, Mar 13, 2009 at 09:22:41AM -0700, Bradley Giesbrecht wrote:
> >>/usr/share/man/man3/CGI.3pm.gz is found before /opt/local/share/
> >>perl5.8/man/man3p/CGI.3pm even when MANPATH looks like this:
> >>
> >>/opt/local/share/man:/usr/share/man:/usr/X11/man:/usr/local/share/man
> >>
> >>I'm not saying I like this solution but changing the Portfile to add
> >>perl5.8/man:
> >>   -D man1dir='${prefix}/share/perl5.8/man/man1' \
> >>   -D man3dir='${prefix}/share/perl5.8/man/man3' \
> >>   -D siteman1dir='${prefix}/share/man/man1' \
> >>   -D siteman3dir='${prefix}/share/man/man3' \
> >>   -D vendorman1dir='${prefix}/share/man/man1' \
> >>   -D vendorman3dir='${prefix}/share/man/man3'
> >>
> >>and making my MANPATH look like:
> >>
> >>/opt/local/share/man:/opt/local/share/perl5.8/man:/opt/local/man:/ 
> >>usr/
> >>share/man:/usr/X11/man:/usr/local/share/man
> >>
> >>causes perl5.8 module man pages to be found before apple installed  
> >>man
> >>pages.
> >
> >	I really don't like changing MANPATH, its auto-generated
> >(for the most part) and I think that's a Good Thing(tm).  Forcing
> >people to set a MANPATH will result in breakage.
> 
> Aren't we already adding macports /opt/local/share/man to MANPATH?

	No, /opt/local/share/man gets auto-added to the search paths
for man when /opt/local/bin is in one's PATH.

	So far as the search order goes, the system-installed /etc/man.conf
has:

	MANSECT		1:1p:8:2:3:3p:4:5:6:7:9:0p:tcl:n:l:p:o

	which means that man will search section 1, then section 1p,
then section 8, then section 2, then section 3, then section 3p, and so on.
The reason you're seeing the system-installed perl (base/core) man pages
is that man searches all the paths for each section, then moves on to
the next section.
	Again, I agree it'd be better to get the MP installed man pages
first if possible without doing things like setting MANPATH.  I feel that
picking up the "wrong" man pages is an acceptable (if undesired) consequence
of getting p5-* installs to work without -f.
	Looking at man a bit more, you could do a couple of things to change
this behavior.  You could set a MANSECT environment variable, and put 3p
in front of 3.  Getting crazy with that idea, you could do (for sh/bash/etc.):

	MANSECT=`egrep '^MANSECT' /etc/man.conf | sed -E 's/:3:3p:/:3p:3:/'`
	export MANSECT

or for csh/tcsh:

	setenv MANSECT `egrep '^MANSECT' /etc/man.conf | sed -E 's/:3:3p:/:3p:3:/'`

	This would set the MANSECT variable to what is /etc/man.conf
except for re-ordering 3 and 3p.

	As well, I don't use the man pages for perl modules much, I find
that perldoc MODULE_NAME is generally much better documentation.  Perhaps
this is true for most people, I don't know.


		-eric




More information about the macports-dev mailing list