NetBSD/share/man/tools/ckso
1998-01-09 08:03:16 +00:00

50 lines
963 B
Bash
Executable File

#! /bin/sh
#
# $NetBSD: ckso,v 1.2 1998/01/09 08:04:58 perry Exp $
#
set x $*
. ./.param
for dir in $DIRLST
do
> $TMPDIR/tmp.$$
date > $TMPDIR/badso$dir
echo >> $TMPDIR/badso$dir
date > $TMPDIR/needso$dir
echo >> $TMPDIR/needso$dir
cd $MANDIR/man$dir
for file in $FILLST
do
ln=`line < $file`
so=`echo $ln | sed "s/ .*//"`
if test "$so" = ".so"
then
so=`echo $ln | sed -e "s/.so//" -e "s/^/ls/"`
echo $so >> $TMPDIR/tmp.$$
else
ed - $file > $TMPDIR/tmp2.$$ <<!
/^\.SH NAME/+s/ .-.*//p
q
!
name=`line < $TMPDIR/tmp2.$$`
echo $name | grep "," > /dev/null
if test $? -eq 0
then
name=`echo $name | sed "s/,/ /g"`
for ent in $name
do
if test $ent = `echo $file | sed "s/\..*//"`
then
continue
fi
ls $MANDIR/man$dir/$ent.* 2>&1 | grep "not found" >> $TMPDIR/needso$dir
done
fi
fi
done
cd $TMPDIR
sh tmp.$$ 2>&1 | grep "not found" >> badso$dir
rm -f tmp.$$ tmp2.$$
done