set GROFF_TMAC_PATH for a release-specific mdoc.local file

this fix the problem with wrong release number in footer
Submitted by: Jeremy C. Reed <reed@reedmedia.net>
This commit is contained in:
Wolfram Schneider 2006-02-17 09:03:50 +00:00
parent 2c3d96a584
commit 4e9f7d8b47
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/www/; revision=27160

View file

@ -33,7 +33,7 @@
# BSDI Id: bsdi-man,v 1.2 1995/01/11 02:30:01 polk Exp # BSDI Id: bsdi-man,v 1.2 1995/01/11 02:30:01 polk Exp
# Dual CGI/Plexus mode and new interface by sanders@bsdi.com 9/22/1995 # Dual CGI/Plexus mode and new interface by sanders@bsdi.com 9/22/1995
# #
# $Id: man.cgi,v 1.152 2006-02-03 13:17:29 wosch Exp $ # $Id: man.cgi,v 1.153 2006-02-17 09:03:50 wosch Exp $
#use Data::Dumper; #use Data::Dumper;
#use Carp; #use Carp;
@ -691,8 +691,10 @@ sub man {
if ($manpath) { if ($manpath) {
if ($manPath{$manpath}) { if ($manPath{$manpath}) {
unshift(@manargs, ('-M', $manPath{$manpath})); unshift(@manargs, ('-M', $manPath{$manpath}));
&groff_path($manPath{$manpath});
} elsif ($manpath{&dec($manpath)}) { } elsif ($manpath{&dec($manpath)}) {
unshift(@manargs, ('-M', $manPath{&dec($manpath)})); unshift(@manargs, ('-M', $manPath{&dec($manpath)}));
&groff_path( $manPath{&dec($manpath)} );
} else { } else {
# unset invalid manpath # unset invalid manpath
print "x $manpath x\n"; print "x $manpath x\n";
@ -822,6 +824,28 @@ sub man {
select undef, undef, undef, 0.35; select undef, undef, undef, 0.35;
} }
#
# You may need to precreate some mdoc.local files for every system you
# support (every collection of man pages), maybe like:
#
# $manLocalDir/NetBSD-1.4.2/tmac
#
# and then in your cgi script itself set the GROFF_TMAC_PATH as appropriate
# like:
#
# GROFF_TMAC_PATH=$manLocalDir/NetBSD-1.4.2/tmac:/usr/share/tmac/
#
sub groff_path {
local $manpath = shift;
local @groff_path;
foreach (split(/:/, $manpath)) {
push(@groff_path, $_ . '/tmac');
}
$ENV{'GROFF_TMAC_PATH'} = join(':', @groff_path, '/usr/share/tmac');
}
sub mlnk { sub mlnk {
local($matched) = @_; local($matched) = @_;
local($link, $section); local($link, $section);
@ -1049,7 +1073,7 @@ ETX
} }
sub copyright { sub copyright {
$id = '$Id: man.cgi,v 1.152 2006-02-03 13:17:29 wosch Exp $'; $id = '$Id: man.cgi,v 1.153 2006-02-17 09:03:50 wosch Exp $';
return qq{\ return qq{\
<PRE> <PRE>