From 4e9f7d8b479266df9af56026e75a1b2c4948c884 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Fri, 17 Feb 2006 09:03:50 +0000 Subject: [PATCH] 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 --- en/cgi/man.cgi | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/en/cgi/man.cgi b/en/cgi/man.cgi index 732196f300..73f77b76dc 100755 --- a/en/cgi/man.cgi +++ b/en/cgi/man.cgi @@ -33,7 +33,7 @@ # 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 # -# $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 Carp; @@ -691,8 +691,10 @@ sub man { if ($manpath) { if ($manPath{$manpath}) { unshift(@manargs, ('-M', $manPath{$manpath})); + &groff_path($manPath{$manpath}); } elsif ($manpath{&dec($manpath)}) { unshift(@manargs, ('-M', $manPath{&dec($manpath)})); + &groff_path( $manPath{&dec($manpath)} ); } else { # unset invalid manpath print "x $manpath x\n"; @@ -822,6 +824,28 @@ sub man { 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 { local($matched) = @_; local($link, $section); @@ -1049,7 +1073,7 @@ ETX } 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{\