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.
This commit is contained in:
parent
34bf96ce4b
commit
273bd7bd61
16
man/update_links.sh
Executable file
16
man/update_links.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/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
|
24
update.sh
24
update.sh
@ -260,25 +260,19 @@ echo "copying manpages"
|
||||
done
|
||||
|
||||
echo "install-data-hook:" >> Makefile.am
|
||||
source ./links
|
||||
for i in $SSL_MLINKS; do
|
||||
for i in `cat ./links`; do
|
||||
IFS=","; set $i; unset IFS
|
||||
echo " ln -f \$(DESTDIR)\$(mandir)/man3/$1 \\" >> Makefile.am
|
||||
echo " \$(DESTDIR)\$(mandir)/man3/$2" >> Makefile.am
|
||||
done
|
||||
for i in $TLS_MLINKS; do
|
||||
IFS=","; set $i; unset IFS
|
||||
echo " ln -f \$(DESTDIR)\$(mandir)/man3/$1 \\" >> Makefile.am
|
||||
echo " \$(DESTDIR)\$(mandir)/man3/$2" >> Makefile.am
|
||||
if [ "$2" != "" ]; then
|
||||
echo " ln -f \$(DESTDIR)\$(mandir)/man3/$1 \\" >> Makefile.am
|
||||
echo " \$(DESTDIR)\$(mandir)/man3/$2" >> Makefile.am
|
||||
fi
|
||||
done
|
||||
echo "" >> Makefile.am
|
||||
echo "uninstall-local:" >> Makefile.am
|
||||
for i in $SSL_MLINKS; do
|
||||
for i in `cat ./links`; do
|
||||
IFS=","; set $i; unset IFS
|
||||
echo " -rm -f \$(DESTDIR)\$(mandir)/man3/$2" >> Makefile.am
|
||||
done
|
||||
for i in $TLS_MLINKS; do
|
||||
IFS=","; set $i; unset IFS
|
||||
echo " rm -f \$(DESTDIR)\$(mandir)/man3/$2" >> Makefile.am
|
||||
if [ "$2" != "" ]; then
|
||||
echo " -rm -f \$(DESTDIR)\$(mandir)/man3/$2" >> Makefile.am
|
||||
fi
|
||||
done
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user