aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <bcook@openbsd.org>2016-11-05 12:25:52 -0500
committerBrent Cook <bcook@openbsd.org>2016-11-05 12:31:29 -0500
commit55419a0dde74ee8ef2306a7893188d3d8855b972 (patch)
treee4240a2afa282f26da3b671912d8c825ea2796a4
parent0241a8d4da9ebc524ab96054f065d9265f139c0d (diff)
downloadportable-55419a0dde74ee8ef2306a7893188d3d8855b972.tar.gz
portable-55419a0dde74ee8ef2306a7893188d3d8855b972.tar.bz2
portable-55419a0dde74ee8ef2306a7893188d3d8855b972.zip
use the new mlinks tool to generate man links
-rwxr-xr-xman/update_links.sh27
1 files changed, 14 insertions, 13 deletions
diff --git a/man/update_links.sh b/man/update_links.sh
index 3bccd0c..04a8694 100755
--- a/man/update_links.sh
+++ b/man/update_links.sh
@@ -1,18 +1,19 @@
1#!/bin/sh 1#!/bin/sh
2 2
3# Run this periodically to ensure that the manpage links are up to date 3# Run this periodically to ensure that the manpage links are up to date
4(
5 cd /usr/src/usr.bin/mandoc/
6 make obj
7 make cleandir
8 make depend
9 make
10 cd /usr/src/regress/usr.bin/mandoc/db/mlinks/
11 make obj
12 make cleandir
13 make
14)
15
16makewhatis -a .
4 17
5echo "# This is an auto-generated file by $0" > links 18echo "# This is an auto-generated file by $0" > links
6doas makewhatis 19/usr/src/regress/usr.bin/mandoc/db/mlinks/obj/mlinks mandoc.db | sort >> links
7for i in `ls -1 *.3`; do
8 name=`echo $i|cut -d. -f1`
9 links=`sqlite3 /usr/share/man/mandoc.db \
10 "select names.name from mlinks,names where mlinks.name='$name' and mlinks.pageid=names.pageid;"`
11 for j in $links; do
12 a=`echo "x$j" | tr '[:upper:]' '[:lower:]'`
13 b=`echo "x$name" | tr '[:upper:]' '[:lower:]'`
14 if [[ $a != $b && $a != *"<type>"* ]]; then
15 echo $name.3,$j.3 >> links
16 fi
17 done
18done