diff options
Diffstat (limited to 'man/update_links.sh')
-rwxr-xr-x | man/update_links.sh | 16 |
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 | |||
5 | echo "# This is an auto-generated file by $0" > links | ||
6 | sudo makewhatis | ||
7 | for 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 | ||
16 | done | ||