From 51c3484a9f70f03b2ea73151428a40e785c0c56c Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Fri, 28 Apr 2006 10:35:05 +0000 Subject: [PATCH] - added missing script --- utils/manlink | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100755 utils/manlink diff --git a/utils/manlink b/utils/manlink new file mode 100755 index 000000000..84e6031b2 --- /dev/null +++ b/utils/manlink @@ -0,0 +1,74 @@ +#! /bin/sh +# +# $Id: manlink,v 1.1 2004/03/15 20:35:27 as Exp $ +# +# make list of alternate names for manpages + +PATH=/bin:/usr/bin ; export PATH +usage="$0 manpage ..." + +for m +do + bm=`basename $m` + if test ! -f $m + then + echo "$0: cannot find \`$m'" >&2 + exit 1 + fi + suf=$(expr $bm : '.*\([.][^.][^.]*\)$') + + # a .\"+ line rules + them=$(awk '/^\.\\"\+[ ]/ { for (i = 2; i <= NF; i++) print $i }' $m) + + # otherwise, try to intuit the list of names from the NAME section + if test " $them" = " " + then + them=$( awk '/^\.SH[ \t]+NAME/,/^\.SH[ \t]+[^N]/' $m | + egrep -v '^\.' | tr ' ,' ' ' | + sed -n '/ *\\*- *.*/s///p' | tr -s ' ' '\012' | + egrep -v '^ipsec$' ) + fi + + # do it + for f in $them + do + case $f in + ipsec*) ff="$f" ;; # ipsec.8, ipsec.conf.5, etc. + *) ff="ipsec_$f" ;; + esac + case $ff in + *.[1-8]) ;; + *) ff="$ff$suf" ;; + esac + #echo "Q: $bm FF: $ff" >&2 + if [ " $ff" != " $bm" ] && [ " $ff" != " ipsec_$bm" ] + then + echo $bm $ff + fi + done +done + +# +# $Log: manlink,v $ +# Revision 1.1 2004/03/15 20:35:27 as +# added files from freeswan-2.04-x509-1.5.3 +# +# Revision 1.8 2002/09/17 20:17:16 sam +# +# The "make doc" fix broke "make install" silently; some man page symlinks +# were being linked incorrectly. This resulted in files which passed the make +# install test but linked to nothing. +# +# Revision 1.7 2002/08/07 06:23:35 sam +# +# freeswan/packaging/utils/manlink +# +# Revision 1.6 2002/05/06 21:20:24 mcr +# manlink -n idea is a fail. It depended upon being able to +# read the man page at the installed location, which isn't going +# to work consistently. manlink now just generates a list of links +# that should be made, leaving the Makefile script to decide what +# to do with them. Further, it now processes the files found in the +# repository, rather than the ones installed. +# +#