libressl-portable/man/update_links.sh
Brent Cook 273bd7bd61 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.
2015-03-27 06:42:45 -05:00

17 lines
462 B
Bash
Executable File

#!/bin/sh
# Run this periodically to ensure that the manpage links are up to date
echo "# This is an auto-generated file by $0" > links
sudo makewhatis
for i in `ls -1 *.3`; do
name=`echo $i|cut -d. -f1`
links=`sqlite3 /usr/share/man/mandoc.db \
"select names.name from mlinks,names where mlinks.name='$name' and mlinks.pageid=names.pageid;"`
for j in $links; do
if [ "x$j" != "x$name" ]; then
echo $name.3,$j.3 >> links
fi
done
done