aboutsummaryrefslogtreecommitdiff
path: root/man/update_links.sh
diff options
context:
space:
mode:
authorBrent Cook <bcook@openbsd.org>2015-03-27 06:42:45 -0500
committerBrent Cook <bcook@openbsd.org>2015-03-27 06:42:45 -0500
commit273bd7bd61cbf37219dcefa5ccc7e3e40ae1cb76 (patch)
tree3e57a3d723c494fccbd149184a66fa77dfc7fd19 /man/update_links.sh
parent34bf96ce4b151e1ebcdd048fe4891139bcea760a (diff)
downloadportable-273bd7bd61cbf37219dcefa5ccc7e3e40ae1cb76.tar.gz
portable-273bd7bd61cbf37219dcefa5ccc7e3e40ae1cb76.tar.bz2
portable-273bd7bd61cbf37219dcefa5ccc7e3e40ae1cb76.zip
Use mandoc database to get man links.
Previously, we semi-manually grabbed the MLINKS from the libressl Makefiles. The better way is to extract this information from the mandoc link database files directly, allowing for MLINKS to eventually go away upstream.
Diffstat (limited to 'man/update_links.sh')
-rwxr-xr-xman/update_links.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/man/update_links.sh b/man/update_links.sh
new file mode 100755
index 0000000..fe75640
--- /dev/null
+++ b/man/update_links.sh
@@ -0,0 +1,16 @@
1#!/bin/sh
2
3# Run this periodically to ensure that the manpage links are up to date
4
5echo "# This is an auto-generated file by $0" > links
6sudo makewhatis
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 if [ "x$j" != "x$name" ]; then
13 echo $name.3,$j.3 >> links
14 fi
15 done
16done