Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/usr.sbin/makemandb Pull up the following revisions(s) (re...



details:   https://anonhg.NetBSD.org/src/rev/e6f91cb9b27b
branches:  netbsd-6
changeset: 773784:e6f91cb9b27b
user:      sborrill <sborrill%NetBSD.org@localhost>
date:      Mon Feb 20 22:04:30 2012 +0000

description:
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".

diffstat:

 usr.sbin/makemandb/apropos.1   |  5 +++--
 usr.sbin/makemandb/makemandb.8 |  5 +++--
 usr.sbin/makemandb/whatis.c    |  8 +++++---
 3 files changed, 11 insertions(+), 7 deletions(-)

diffs (88 lines):

diff -r 2bcea67ec9b8 -r e6f91cb9b27b usr.sbin/makemandb/apropos.1
--- a/usr.sbin/makemandb/apropos.1      Mon Feb 20 21:55:44 2012 +0000
+++ b/usr.sbin/makemandb/apropos.1      Mon Feb 20 22:04:30 2012 +0000
@@ -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 <er.abhinav.upadhyay%gmail.com@localhost>
 .\" 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 @@
 .El
 .Sh SEE ALSO
 .Xr man 1 ,
+.Xr whatis 1 ,
 .Xr makemandb 8
 .Sh AUTHORS
 .An Abhinav Upadhyay
diff -r 2bcea67ec9b8 -r e6f91cb9b27b usr.sbin/makemandb/makemandb.8
--- a/usr.sbin/makemandb/makemandb.8    Mon Feb 20 21:55:44 2012 +0000
+++ b/usr.sbin/makemandb/makemandb.8    Mon Feb 20 22:04:30 2012 +0000
@@ -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 <er.abhinav.upadhyay%gmail.com@localhost>
 .\" 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 @@
 .Sh SEE ALSO
 .Xr apropos 1 ,
 .Xr man 1 ,
+.Xr whatis 1 ,
 .Xr man.conf 5
 .Sh AUTHORS
 .An Abhinav Upadhyay
diff -r 2bcea67ec9b8 -r e6f91cb9b27b usr.sbin/makemandb/whatis.c
--- a/usr.sbin/makemandb/whatis.c       Mon Feb 20 21:55:44 2012 +0000
+++ b/usr.sbin/makemandb/whatis.c       Mon Feb 20 22:04:30 2012 +0000
@@ -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 <joerg%NetBSD.org@localhost>
  * 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 @@
 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 @@
                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),



Home | Main Index | Thread Index | Old Index