Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Import the new apropos/whatis.
details: https://anonhg.NetBSD.org/src/rev/8dcd1c74d4c1
branches: trunk
changeset: 773580:8dcd1c74d4c1
user: joerg <joerg%NetBSD.org@localhost>
date: Tue Feb 07 19:13:24 2012 +0000
description:
Import the new apropos/whatis.
This code has been developed by Abhinav Upadhyay as part of Google's Summer
of Code 2011. It uses libmandoc to parse man pages and builds a Full
Text Index in a SQLite database. The combination of indexing the full
manual page, filtering out stop words and ranking individual matches
based on the section gives a much improved user experience.
The old makewhatis and friends are kept under MKMAKEMANDB=no for now.
diffstat:
distrib/sets/lists/base/mi | 10 +-
distrib/sets/lists/comp/mi | 7 +-
distrib/sets/lists/etc/mi | 3 +-
distrib/sets/lists/man/mi | 17 +-
distrib/sets/lists/text/mi | 3 +-
distrib/sets/lists/xbase/mi | 6 +-
distrib/sets/sets.subr | 5 +-
etc/daily | 12 +-
etc/defaults/daily.conf | 3 +-
etc/defaults/rc.conf | 5 +-
etc/defaults/weekly.conf | 3 +-
etc/rc.d/Makefile | 4 +-
etc/rc.d/makemandb | 24 +
etc/weekly | 15 +-
lib/Makefile | 4 +-
libexec/Makefile | 10 +-
share/man/Makefile | 7 +-
share/man/man0/Makefile | 4 +-
share/mk/bsd.own.mk | 3 +-
usr.bin/Makefile | 10 +-
usr.sbin/Makefile | 6 +-
usr.sbin/makemandb/DBSCHEMA | 52 +
usr.sbin/makemandb/Makefile | 40 +
usr.sbin/makemandb/apropos-utils.3 | 67 +
usr.sbin/makemandb/apropos-utils.c | 755 +++++++++++++
usr.sbin/makemandb/apropos-utils.h | 92 +
usr.sbin/makemandb/apropos.1 | 107 +
usr.sbin/makemandb/apropos.c | 277 ++++
usr.sbin/makemandb/close_db.3 | 62 +
usr.sbin/makemandb/init_db.3 | 92 +
usr.sbin/makemandb/makemandb.8 | 109 +
usr.sbin/makemandb/makemandb.c | 1940 ++++++++++++++++++++++++++++++++++
usr.sbin/makemandb/run_query.3 | 223 +++
usr.sbin/makemandb/run_query_html.3 | 116 ++
usr.sbin/makemandb/run_query_pager.3 | 106 +
usr.sbin/makemandb/stopwords.txt | 251 ++++
usr.sbin/makemandb/whatis.1 | 58 +
usr.sbin/makemandb/whatis.c | 101 +
38 files changed, 4567 insertions(+), 42 deletions(-)
diffs (truncated from 5064 to 300 lines):
diff -r 9f1d05ac1f2a -r 8dcd1c74d4c1 distrib/sets/lists/base/mi
--- a/distrib/sets/lists/base/mi Tue Feb 07 18:48:19 2012 +0000
+++ b/distrib/sets/lists/base/mi Tue Feb 07 19:13:24 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.980 2012/02/05 14:19:04 dholland Exp $
+# $NetBSD: mi,v 1.981 2012/02/07 19:13:25 joerg Exp $
#
# Note: Don't delete entries from here - mark them as "obsolete" instead,
# unless otherwise stated below.
@@ -1023,7 +1023,7 @@
./usr/libexec/fingerd base-netutil-bin
./usr/libexec/ftp-proxy base-obsolete obsolete
./usr/libexec/ftpd base-netutil-bin
-./usr/libexec/getNAME base-man-bin
+./usr/libexec/getNAME base-man-bin !makemandb
./usr/libexec/getty base-sysutil-bin
./usr/libexec/hprop base-obsolete obsolete
./usr/libexec/hpropd base-krb5-bin kerberos
@@ -1044,7 +1044,7 @@
./usr/libexec/lpr/pjlfilter base-lpr-bin
./usr/libexec/mail.local base-mail-bin
./usr/libexec/makekey base-crypto-bin
-./usr/libexec/makewhatis base-man-bin
+./usr/libexec/makewhatis base-man-bin !makemandb
./usr/libexec/named-xfer base-obsolete obsolete
./usr/libexec/ntalkd base-netutil-bin
./usr/libexec/pfspamd base-obsolete obsolete
@@ -3614,7 +3614,7 @@
./usr/share/man/html9/vax base-man-share
./usr/share/man/html9/x68k base-man-share
./usr/share/man/html9/x86 base-man-share
-./usr/share/man/makewhatis.sed base-man-share share
+./usr/share/man/makewhatis.sed base-man-share !makemandb,share
./usr/share/man/man1 base-man-share
./usr/share/man/man1/atari base-man-share
./usr/share/man/man1/hp300 base-man-share
@@ -3742,7 +3742,7 @@
./usr/share/man/man9/vax base-man-share
./usr/share/man/man9/x68k base-man-share
./usr/share/man/man9/x86 base-man-share
-./usr/share/man/whatis.db base-man-share man
+./usr/share/man/whatis.db base-man-share man,!makemandb
./usr/share/me base-groff-share
./usr/share/misc base-terminfo-share
./usr/share/misc/acronyms base-reference-share share
diff -r 9f1d05ac1f2a -r 8dcd1c74d4c1 distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi Tue Feb 07 18:48:19 2012 +0000
+++ b/distrib/sets/lists/comp/mi Tue Feb 07 19:13:24 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1730 2012/02/05 14:19:05 dholland Exp $
+# $NetBSD: mi,v 1.1731 2012/02/07 19:13:25 joerg Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -3971,7 +3971,7 @@
./usr/libdata/debug/usr/libexec/fingerd.debug comp-netutil-debug debug
./usr/libdata/debug/usr/libexec/ftp-proxy.debug comp-obsolete obsolete
./usr/libdata/debug/usr/libexec/ftpd.debug comp-netutil-debug debug
-./usr/libdata/debug/usr/libexec/getNAME.debug comp-man-debug debug
+./usr/libdata/debug/usr/libexec/getNAME.debug comp-man-debug !makemandb,debug
./usr/libdata/debug/usr/libexec/getty.debug comp-sysutil-debug debug
./usr/libdata/debug/usr/libexec/hpropd.debug comp-krb5-debug kerberos,debug
./usr/libdata/debug/usr/libexec/httpd.debug comp-netutil-debug debug
@@ -3988,7 +3988,7 @@
./usr/libdata/debug/usr/libexec/lpr/lpf.debug comp-lpr-debug debug
./usr/libdata/debug/usr/libexec/mail.local.debug comp-mail-debug debug
./usr/libdata/debug/usr/libexec/makekey.debug comp-crypto-debug debug
-./usr/libdata/debug/usr/libexec/makewhatis.debug comp-man-debug debug
+./usr/libdata/debug/usr/libexec/makewhatis.debug comp-man-debug !makemandb,debug
./usr/libdata/debug/usr/libexec/ntalkd.debug comp-netutil-debug debug
./usr/libdata/debug/usr/libexec/pcpp.debug comp-c-debug pcc,debug
./usr/libdata/debug/usr/libexec/postfix/anvil.debug comp-postfix-debug postfix,debug
@@ -4148,6 +4148,7 @@
./usr/libdata/debug/usr/sbin/lpd.debug comp-lpr-debug debug
./usr/libdata/debug/usr/sbin/lptest.debug comp-lpr-debug debug
./usr/libdata/debug/usr/sbin/mailwrapper.debug comp-mailwrapper-debug debug
+./usr/libdata/debug/usr/sbin//makemandb.debug comp-makemandb-debug makemandb,debug
./usr/libdata/debug/usr/sbin/makedbm.debug comp-nis-debug yp,debug
./usr/libdata/debug/usr/sbin/makefs.debug comp-sysutil-debug debug
./usr/libdata/debug/usr/sbin/map-mbone.debug comp-netutil-debug debug
diff -r 9f1d05ac1f2a -r 8dcd1c74d4c1 distrib/sets/lists/etc/mi
--- a/distrib/sets/lists/etc/mi Tue Feb 07 18:48:19 2012 +0000
+++ b/distrib/sets/lists/etc/mi Tue Feb 07 19:13:24 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.227 2011/12/17 13:37:49 tsutsui Exp $
+# $NetBSD: mi,v 1.228 2012/02/07 19:13:28 joerg Exp $
#
# Note: end-user configuration files that are moved to another location
# should not be marked "obsolete"; they should just be removed from
@@ -223,6 +223,7 @@
./etc/rc.d/local etc-sys-rc
./etc/rc.d/lpd etc-lpr-rc
./etc/rc.d/lvm etc-sys-rc
+./etc/rc.d/makemandb etc-man-rc
./etc/rc.d/mdnsd etc-mdns-rc
./etc/rc.d/mixerctl etc-audio-rc
./etc/rc.d/mopd etc-bootserver-rc
diff -r 9f1d05ac1f2a -r 8dcd1c74d4c1 distrib/sets/lists/man/mi
--- a/distrib/sets/lists/man/mi Tue Feb 07 18:48:19 2012 +0000
+++ b/distrib/sets/lists/man/mi Tue Feb 07 19:13:24 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1375 2012/02/03 22:18:05 joerg Exp $
+# $NetBSD: mi,v 1.1376 2012/02/07 19:13:29 joerg Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -2313,7 +2313,7 @@
./usr/share/man/cat8/fusermount.0 man-refuse-catman .cat
./usr/share/man/cat8/fwctl.0 man-sysutil-catman .cat
./usr/share/man/cat8/genassym.sh.0 man-obsolete obsolete
-./usr/share/man/cat8/getNAME.0 man-man-catman .cat
+./usr/share/man/cat8/getNAME.0 man-man-catman !makemandb, .cat
./usr/share/man/cat8/getencstat.0 man-sysutil-catman .cat
./usr/share/man/cat8/gettable.0 man-obsolete obsolete
./usr/share/man/cat8/getty.0 man-sysutil-catman .cat
@@ -2477,8 +2477,9 @@
./usr/share/man/cat8/makedev.local.0 man-sysutil-catman .cat
./usr/share/man/cat8/makefs.0 man-sysutil-catman .cat
./usr/share/man/cat8/makekey.0 man-crypto-catman .cat
+./usr/share/man/cat8/makemandb.0 man-man-catman makemandb,.cat
./usr/share/man/cat8/makemap.0 man-obsolete obsolete
-./usr/share/man/cat8/makewhatis.0 man-man-catman .cat
+./usr/share/man/cat8/makewhatis.0 man-man-catman !makemandb,.cat
./usr/share/man/cat8/map-mbone.0 man-netutil-catman .cat
./usr/share/man/cat8/master.0 man-postfix-catman postfix,.cat
./usr/share/man/cat8/mbr.0 man-obsolete obsolete
@@ -5015,7 +5016,7 @@
./usr/share/man/html8/ftpd.html man-netutil-htmlman html
./usr/share/man/html8/fusermount.html man-refuse-htmlman html
./usr/share/man/html8/fwctl.html man-sysutil-htmlman html
-./usr/share/man/html8/getNAME.html man-man-htmlman html
+./usr/share/man/html8/getNAME.html man-man-htmlman !makemandb,html
./usr/share/man/html8/getencstat.html man-sysutil-htmlman html
./usr/share/man/html8/getty.html man-sysutil-htmlman html
./usr/share/man/html8/gpioctl.html man-sysutil-htmlman html
@@ -5141,7 +5142,8 @@
./usr/share/man/html8/makedev.local.html man-sysutil-htmlman html
./usr/share/man/html8/makefs.html man-sysutil-htmlman html
./usr/share/man/html8/makekey.html man-crypto-htmlman html
-./usr/share/man/html8/makewhatis.html man-man-htmlman html
+./usr/share/man/html8/makemandb.html man-man-htmlman makemandb,html
+./usr/share/man/html8/makewhatis.html man-man-htmlman !makemandb,html
./usr/share/man/html8/map-mbone.html man-netutil-htmlman html
./usr/share/man/html8/master.html man-postfix-htmlman postfix,html
./usr/share/man/html8/mbrlabel.html man-sysutil-htmlman html
@@ -7811,7 +7813,7 @@
./usr/share/man/man8/fusermount.8 man-refuse-man .man
./usr/share/man/man8/fwctl.8 man-sysutil-man .man
./usr/share/man/man8/genassym.sh.8 man-obsolete obsolete
-./usr/share/man/man8/getNAME.8 man-man-man .man
+./usr/share/man/man8/getNAME.8 man-man-man !makemandb,.man
./usr/share/man/man8/getencstat.8 man-sysutil-man .man
./usr/share/man/man8/gettable.8 man-obsolete obsolete
./usr/share/man/man8/getty.8 man-sysutil-man .man
@@ -7976,8 +7978,9 @@
./usr/share/man/man8/makedev.local.8 man-sysutil-man .man
./usr/share/man/man8/makefs.8 man-sysutil-man .man
./usr/share/man/man8/makekey.8 man-crypto-man .man
+./usr/share/man/man8/makemandb.8 man-man-man makemandb,.man
./usr/share/man/man8/makemap.8 man-obsolete obsolete
-./usr/share/man/man8/makewhatis.8 man-man-man .man
+./usr/share/man/man8/makewhatis.8 man-man-man !makemandb,.man
./usr/share/man/man8/map-mbone.8 man-netutil-man .man
./usr/share/man/man8/master.8 man-postfix-man postfix,.man
./usr/share/man/man8/mbr.8 man-obsolete obsolete
diff -r 9f1d05ac1f2a -r 8dcd1c74d4c1 distrib/sets/lists/text/mi
--- a/distrib/sets/lists/text/mi Tue Feb 07 18:48:19 2012 +0000
+++ b/distrib/sets/lists/text/mi Tue Feb 07 19:13:24 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.41 2011/10/11 19:20:13 joerg Exp $
+# $NetBSD: mi,v 1.42 2012/02/07 19:13:29 joerg Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -40,6 +40,7 @@
./usr/bin/troff text-groff-bin groff
./usr/bin/vgrind text-groff-bin
./usr/libexec/vfontedpr text-groff-bin
+./usr/sbin/makemandb base-man-bin makemandb
./usr/share/doc/groff text-groff-doc
./usr/share/doc/groff/mom text-groff-doc
./usr/share/doc/groff/mom/README.txt text-groff-doc share,groff
diff -r 9f1d05ac1f2a -r 8dcd1c74d4c1 distrib/sets/lists/xbase/mi
--- a/distrib/sets/lists/xbase/mi Tue Feb 07 18:48:19 2012 +0000
+++ b/distrib/sets/lists/xbase/mi Tue Feb 07 19:13:24 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.111 2011/10/22 22:23:50 jmcneill Exp $
+# $NetBSD: mi,v 1.112 2012/02/07 19:13:30 joerg Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -1340,7 +1340,7 @@
./usr/X11R6/man/man7/XProjectTeam.7 xbase-obsolete obsolete
./usr/X11R6/man/man7/XStandards.7 -unknown- .man,x11
./usr/X11R6/man/man7/Xsecurity.7 -unknown- .man,x11
-./usr/X11R6/man/whatis.db -unknown- man,x11
+./usr/X11R6/man/whatis.db -unknown- man,x11,!makemandb
./usr/X11R6/share base-x11-root x11
./usr/X11R6/share/examples base-x11-root x11
./usr/X11R6/share/examples/ssh-askpass base-x11-root x11
@@ -2888,7 +2888,7 @@
./usr/X11R7/man/man7/XOrgFoundation.7 -unknown- .man,xorg
./usr/X11R7/man/man7/XProjectTeam.7 -unknown- .man,xorg
./usr/X11R7/man/man7/Xsecurity.7 -unknown- .man,xorg
-./usr/X11R7/man/whatis.db -unknown- man,xorg
+./usr/X11R7/man/whatis.db -unknown- man,xorg,!makemandb
./usr/X11R7/share base-x11-root xorg
./usr/X11R7/share/aclocal base-x11-root xorg
./usr/X11R7/share/examples base-x11-root xorg
diff -r 9f1d05ac1f2a -r 8dcd1c74d4c1 distrib/sets/sets.subr
--- a/distrib/sets/sets.subr Tue Feb 07 18:48:19 2012 +0000
+++ b/distrib/sets/sets.subr Tue Feb 07 19:13:24 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: sets.subr,v 1.134 2012/02/03 22:18:04 joerg Exp $
+# $NetBSD: sets.subr,v 1.135 2012/02/07 19:13:24 joerg Exp $
#
#
@@ -176,7 +176,7 @@
# In each file, a record consists of a path and a System Package name,
# separated by whitespace. E.g.,
#
-# # $NetBSD: sets.subr,v 1.134 2012/02/03 22:18:04 joerg Exp $
+# # $NetBSD: sets.subr,v 1.135 2012/02/07 19:13:24 joerg Exp $
# . base-sys-root [keyword[,...]]
# ./altroot base-sys-root
# ./bin base-sys-root
@@ -228,6 +228,7 @@
# lint ${MKLINT} != no
# llvm ${MKLLVM} != no
# lvm ${MKLVM} != no
+# makemandb ${MKMAKEMANDB} != no
# man ${MKMAN} != no
# manpages ${MKMANPAGES} != no
# manz ${MKMANZ} != no
diff -r 9f1d05ac1f2a -r 8dcd1c74d4c1 etc/daily
--- a/etc/daily Tue Feb 07 18:48:19 2012 +0000
+++ b/etc/daily Tue Feb 07 19:13:24 2012 +0000
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $NetBSD: daily,v 1.78 2011/12/17 12:27:42 darcy Exp $
+# $NetBSD: daily,v 1.79 2012/02/07 19:13:30 joerg Exp $
# @(#)daily 8.2 (Berkeley) 1/25/94
#
@@ -290,6 +290,16 @@
fi
fi
+run_makemandb=YES
+
+if checkyesno run_makemandb; then
+ if [ -f /etc/man.conf -a -x /usr/sbin/makemandb ]; then
+ echo ""
+ echo "Updating man page index:"
+ nice -n 5 /usr/sbin/makemandb
+ fi
+fi
+
if [ -f /etc/daily.local ]; then
( . /etc/daily.local ) > $TMP 2>&1
if [ -s $TMP ] ; then
diff -r 9f1d05ac1f2a -r 8dcd1c74d4c1 etc/defaults/daily.conf
--- a/etc/defaults/daily.conf Tue Feb 07 18:48:19 2012 +0000
+++ b/etc/defaults/daily.conf Tue Feb 07 19:13:24 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: daily.conf,v 1.15 2011/12/17 12:27:42 darcy Exp $
+# $NetBSD: daily.conf,v 1.16 2012/02/07 19:13:30 joerg Exp $
#
# /etc/defaults/daily.conf --
# default configuration of /etc/daily.conf
@@ -25,6 +25,7 @@
full_netstat=NO
run_fsck=NO
run_fsck_flags=""
+run_makemandb=YES
run_rdist=YES
run_security=YES
separate_security_email=YES
diff -r 9f1d05ac1f2a -r 8dcd1c74d4c1 etc/defaults/rc.conf
--- a/etc/defaults/rc.conf Tue Feb 07 18:48:19 2012 +0000
+++ b/etc/defaults/rc.conf Tue Feb 07 19:13:24 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: rc.conf,v 1.118 2011/12/23 05:05:04 tsutsui Exp $
+# $NetBSD: rc.conf,v 1.119 2012/02/07 19:13:30 joerg Exp $
#
# /etc/defaults/rc.conf --
# default configuration of /etc/rc.conf
@@ -366,3 +366,6 @@
# Entropy load/save to/from /dev/random at startup/shutdown
#
random_seed=YES
+
+# Creating / updating of man page index on boot
+makemandb=YES
diff -r 9f1d05ac1f2a -r 8dcd1c74d4c1 etc/defaults/weekly.conf
--- a/etc/defaults/weekly.conf Tue Feb 07 18:48:19 2012 +0000
+++ b/etc/defaults/weekly.conf Tue Feb 07 19:13:24 2012 +0000
@@ -1,4 +1,4 @@
Home |
Main Index |
Thread Index |
Old Index