Module Name: src
Committed By: sborrill
Date: Mon Feb 20 22:04:30 UTC 2012
Modified Files:
src/usr.sbin/makemandb [netbsd-6]: apropos.1 makemandb.8 whatis.c
Log Message:
Pull up the following revisions(s) (requested by joerg in ticket #15):
usr.sbin/makemandb/apropos.1: revision 1.4
usr.sbin/makemandb/makemandb.8: revision 1.2
usr.sbin/makemandb/whatis.c: revision 1.3
Add reference to whatis(1).
SQLite doesn't use the FTS index for equal ops, so force it to do a FTS
search first. Drops run time by a factor of 6 for "whatis man".
To generate a diff of this commit:
cvs rdiff -u -r1.2.2.1 -r1.2.2.2 src/usr.sbin/makemandb/apropos.1
cvs rdiff -u -r1.1 -r1.1.2.1 src/usr.sbin/makemandb/makemandb.8
cvs rdiff -u -r1.2 -r1.2.2.1 src/usr.sbin/makemandb/whatis.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/makemandb/apropos.1
diff -u src/usr.sbin/makemandb/apropos.1:1.2.2.1 src/usr.sbin/makemandb/apropos.1:1.2.2.2
--- src/usr.sbin/makemandb/apropos.1:1.2.2.1 Sat Feb 18 18:03:26 2012
+++ src/usr.sbin/makemandb/apropos.1 Mon Feb 20 22:04:30 2012
@@ -1,4 +1,4 @@
-.\" $NetBSD: apropos.1,v 1.2.2.1 2012/02/18 18:03:26 riz Exp $
+.\" $NetBSD: apropos.1,v 1.2.2.2 2012/02/20 22:04:30 sborrill Exp $
.\"
.\" Copyright (c) 2011 Abhinav Upadhyay <[email protected]>
.\" All rights reserved.
@@ -29,7 +29,7 @@
.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd February 15, 2012
+.Dd February 20, 2012
.Dt APROPOS 1
.Os
.Sh NAME
@@ -112,6 +112,7 @@ The Sqlite FTS database which contains a
.El
.Sh SEE ALSO
.Xr man 1 ,
+.Xr whatis 1 ,
.Xr makemandb 8
.Sh AUTHORS
.An Abhinav Upadhyay
Index: src/usr.sbin/makemandb/makemandb.8
diff -u src/usr.sbin/makemandb/makemandb.8:1.1 src/usr.sbin/makemandb/makemandb.8:1.1.2.1
--- src/usr.sbin/makemandb/makemandb.8:1.1 Tue Feb 7 19:13:32 2012
+++ src/usr.sbin/makemandb/makemandb.8 Mon Feb 20 22:04:30 2012
@@ -1,4 +1,4 @@
-.\" $NetBSD: makemandb.8,v 1.1 2012/02/07 19:13:32 joerg Exp $
+.\" $NetBSD: makemandb.8,v 1.1.2.1 2012/02/20 22:04:30 sborrill Exp $
.\"
.\" Copyright (c) 2011 Abhinav Upadhyay <[email protected]>
.\" All rights reserved.
@@ -29,7 +29,7 @@
.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd February 4, 2012
+.Dd February 20, 2012
.Dt MAKEMANDB 8
.Os
.Sh NAME
@@ -104,6 +104,7 @@ The Sqlite FTS database which contains a
.Sh SEE ALSO
.Xr apropos 1 ,
.Xr man 1 ,
+.Xr whatis 1 ,
.Xr man.conf 5
.Sh AUTHORS
.An Abhinav Upadhyay
Index: src/usr.sbin/makemandb/whatis.c
diff -u src/usr.sbin/makemandb/whatis.c:1.2 src/usr.sbin/makemandb/whatis.c:1.2.2.1
--- src/usr.sbin/makemandb/whatis.c:1.2 Tue Feb 7 19:17:16 2012
+++ src/usr.sbin/makemandb/whatis.c Mon Feb 20 22:04:30 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: whatis.c,v 1.2 2012/02/07 19:17:16 joerg Exp $ */
+/* $NetBSD: whatis.c,v 1.2.2.1 2012/02/20 22:04:30 sborrill Exp $ */
/*-
* Copyright (c) 2012 Joerg Sonnenberger <[email protected]>
* All rights reserved.
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: whatis.c,v 1.2 2012/02/07 19:17:16 joerg Exp $");
+__RCSID("$NetBSD: whatis.c,v 1.2.2.1 2012/02/20 22:04:30 sborrill Exp $");
#include <err.h>
#include <stdio.h>
@@ -49,7 +49,7 @@ static int
whatis(sqlite3 *db, const char *cmd)
{
static const char sqlstr[] = "SELECT name, section, name_desc"
- " FROM mandb WHERE name=?"
+ " FROM mandb WHERE name MATCH ? AND name=?"
" ORDER BY section, name";
sqlite3_stmt *stmt = NULL;
int retval;
@@ -58,6 +58,8 @@ whatis(sqlite3 *db, const char *cmd)
errx(EXIT_FAILURE, "Unable to query database");
if (sqlite3_bind_text(stmt, 1, cmd, -1, NULL) != SQLITE_OK)
errx(EXIT_FAILURE, "Unable to query database");
+ if (sqlite3_bind_text(stmt, 2, cmd, -1, NULL) != SQLITE_OK)
+ errx(EXIT_FAILURE, "Unable to query database");
retval = 1;
while (sqlite3_step(stmt) == SQLITE_ROW) {
printf("%s(%s) - %s\n", sqlite3_column_text(stmt, 0),