From 5cb84ec742fd33f78c8022863fadaa8d0d93e176 Mon Sep 17 00:00:00 2001 From: Jacob McDonnell Date: Sat, 25 Apr 2026 15:32:58 -0400 Subject: feat: Added NetBSD man pages --- static/netbsd/tools/tocrc | 114 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100755 static/netbsd/tools/tocrc (limited to 'static/netbsd/tools/tocrc') diff --git a/static/netbsd/tools/tocrc b/static/netbsd/tools/tocrc new file mode 100755 index 00000000..1d50a053 --- /dev/null +++ b/static/netbsd/tools/tocrc @@ -0,0 +1,114 @@ +MANDIR=/usr/man +TMPDIR=/usr/man/tmp +TOOLS=$MANDIR/tools + +trap "rm $TMPDIR/tmp.$$ ; exit" 2 3 15 + +P=108 +p="" +if test "$1" = "-p" +then + P=65 + p=-p + shift +fi + +if test $# -eq 0 +then + echo "tocrc: no argument" + exit +fi + +if test $# -eq 2 +then + : create toc input file for one section only + + > $TMPDIR/tocx$1 + for file in $MANDIR/man$1/*.$1* + do + if test ! -s $file + then + continue + fi + so=`line < $file | sed "s/ .*//"` + if test "$so" = ".so" + then + continue + fi + ed - $file > $TMPDIR/tmp.$$ < $TMPDIR/tmp.$$ <> $TMPDIR/tocx$1 + fi + rm -f $TMPDIR/tmp.$$ + done +else case $1 in + all ) + : tocx files for all sections and everything else + + for x in 1 2 3 4 5 6 7 8 + do + $0 $p $x $x + done + $0 $p t + ;; + t ) + : permuted index and toc files + + if test ! -f $TMPDIR/tocx1 + then + echo "tocrc: some tocx? files missing" + exit + fi + cat $TMPDIR/tocx? > $TMPDIR/cattoc + ed - $TMPDIR/cattoc <