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 following revision(s) (request...
details: https://anonhg.NetBSD.org/src/rev/bcbc33d07d90
branches: netbsd-6
changeset: 774075:bcbc33d07d90
user: riz <riz%NetBSD.org@localhost>
date: Wed May 09 03:41:00 2012 +0000
description:
Pull up following revision(s) (requested by wiz in ticket #229):
usr.sbin/makemandb/makemandb.c: revision 1.9
usr.sbin/makemandb/DBSCHEMA: revision 1.2
usr.sbin/makemandb/apropos-utils.c: revision 1.5
usr.sbin/makemandb/apropos-utils.h: revision 1.3
PR 46419 by Abhinav Upadhyay using his updated patch:
Clean up after removing man page aliases.
diffstat:
usr.sbin/makemandb/DBSCHEMA | 1 +
usr.sbin/makemandb/apropos-utils.c | 10 ++++++----
usr.sbin/makemandb/apropos-utils.h | 4 ++--
usr.sbin/makemandb/makemandb.c | 10 ++++++----
4 files changed, 15 insertions(+), 10 deletions(-)
diffs (103 lines):
diff -r 73586b4380b9 -r bcbc33d07d90 usr.sbin/makemandb/DBSCHEMA
--- a/usr.sbin/makemandb/DBSCHEMA Wed May 09 03:23:32 2012 +0000
+++ b/usr.sbin/makemandb/DBSCHEMA Wed May 09 03:41:00 2012 +0000
@@ -50,3 +50,4 @@
3. section The section number
4. machine The machine architecture (if any) for which
the page is relevant
+ 5. md5_hash MD5 Hash of the target man page.
diff -r 73586b4380b9 -r bcbc33d07d90 usr.sbin/makemandb/apropos-utils.c
--- a/usr.sbin/makemandb/apropos-utils.c Wed May 09 03:23:32 2012 +0000
+++ b/usr.sbin/makemandb/apropos-utils.c Wed May 09 03:41:00 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: apropos-utils.c,v 1.2.2.1 2012/04/19 20:03:00 riz Exp $ */
+/* $NetBSD: apropos-utils.c,v 1.2.2.2 2012/05/09 03:41:00 riz Exp $ */
/*-
* Copyright (c) 2011 Abhinav Upadhyay <er.abhinav.upadhyay%gmail.com@localhost>
* All rights reserved.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: apropos-utils.c,v 1.2.2.1 2012/04/19 20:03:00 riz Exp $");
+__RCSID("$NetBSD: apropos-utils.c,v 1.2.2.2 2012/05/09 03:41:00 riz Exp $");
#include <sys/stat.h>
@@ -172,7 +172,7 @@
"file UNIQUE, md5_hash UNIQUE, id INTEGER PRIMARY KEY); "
//mandb_meta
"CREATE TABLE IF NOT EXISTS mandb_links(link, target, section, "
- "machine); "; //mandb_links
+ "machine, md5_hash); "; //mandb_links
sqlite3_exec(db, sqlstr, NULL, NULL, &errmsg);
if (errmsg != NULL)
@@ -181,7 +181,9 @@
sqlstr = "CREATE INDEX IF NOT EXISTS index_mandb_links ON mandb_links "
"(link); "
"CREATE INDEX IF NOT EXISTS index_mandb_meta_dev ON mandb_meta "
- "(device, inode)";
+ "(device, inode); "
+ "CREATE INDEX IF NOT EXISTS index_mandb_links_md5 ON mandb_links "
+ "(md5_hash);";
sqlite3_exec(db, sqlstr, NULL, NULL, &errmsg);
if (errmsg != NULL)
goto out;
diff -r 73586b4380b9 -r bcbc33d07d90 usr.sbin/makemandb/apropos-utils.h
--- a/usr.sbin/makemandb/apropos-utils.h Wed May 09 03:23:32 2012 +0000
+++ b/usr.sbin/makemandb/apropos-utils.h Wed May 09 03:41:00 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: apropos-utils.h,v 1.2 2012/02/07 19:17:16 joerg Exp $ */
+/* $NetBSD: apropos-utils.h,v 1.2.2.1 2012/05/09 03:41:00 riz Exp $ */
/*-
* Copyright (c) 2011 Abhinav Upadhyay <er.abhinav.upadhyay%gmail.com@localhost>
* All rights reserved.
@@ -43,7 +43,7 @@
#define MANDB_WRITE SQLITE_OPEN_READWRITE
#define MANDB_CREATE SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE
-#define APROPOS_SCHEMA_VERSION 20120130
+#define APROPOS_SCHEMA_VERSION 20120507
/*
* Used to identify the section of a man(7) page.
diff -r 73586b4380b9 -r bcbc33d07d90 usr.sbin/makemandb/makemandb.c
--- a/usr.sbin/makemandb/makemandb.c Wed May 09 03:23:32 2012 +0000
+++ b/usr.sbin/makemandb/makemandb.c Wed May 09 03:41:00 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: makemandb.c,v 1.2.2.4 2012/05/07 17:02:07 riz Exp $ */
+/* $NetBSD: makemandb.c,v 1.2.2.5 2012/05/09 03:41:00 riz Exp $ */
/*
* Copyright (c) 2011 Abhinav Upadhyay <er.abhinav.upadhyay%gmail.com@localhost>
* Copyright (c) 2011 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
@@ -17,7 +17,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: makemandb.c,v 1.2.2.4 2012/05/07 17:02:07 riz Exp $");
+__RCSID("$NetBSD: makemandb.c,v 1.2.2.5 2012/05/09 03:41:00 riz Exp $");
#include <sys/stat.h>
#include <sys/types.h>
@@ -780,6 +780,8 @@
sqlstr = "DELETE FROM mandb_meta WHERE file NOT IN"
" (SELECT file FROM metadb.file_cache);"
+ "DELETE FROM mandb_links WHERE md5_hash NOT IN"
+ " (SELECT md5_hash from mandb_meta);"
"DROP TABLE metadb.file_cache;"
"DELETE FROM mandb WHERE rowid NOT IN"
" (SELECT id FROM mandb_meta);";
@@ -1726,9 +1728,9 @@
ln[strlen(ln) - 1] = 0;
str = sqlite3_mprintf("INSERT INTO mandb_links"
- " VALUES (%Q, %Q, %Q, %Q)",
+ " VALUES (%Q, %Q, %Q, %Q, %Q)",
ln, rec->name, rec->section,
- rec->machine);
+ rec->machine, rec->md5_hash);
sqlite3_exec(db, str, NULL, NULL, &errmsg);
sqlite3_free(str);
if (errmsg != NULL) {
Home |
Main Index |
Thread Index |
Old Index