merged 1.6 maint branch modifs up to MERGED_TO_TRUNK_20061130

This commit is contained in:
dockes
2006-11-30 13:38:44 +00:00
parent 03b6f05f23
commit 72fd14f208
46 changed files with 417 additions and 245 deletions
+12 -5
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.44 2006-11-07 06:41:44 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.45 2006-11-30 13:38:44 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -161,14 +161,16 @@ bool DbIndexer::createStemmingDatabases()
return true;
}
bool DbIndexer::init(bool resetbefore)
bool DbIndexer::init(bool resetbefore, bool rdonly)
{
if (m_tmpdir.empty() || access(m_tmpdir.c_str(), 0) < 0)
if (!maketmpdir(m_tmpdir)) {
LOGERR(("DbIndexer: cannot create temporary directory\n"));
return false;
}
if (!m_db.open(m_dbdir, resetbefore ? Rcl::Db::DbTrunc : Rcl::Db::DbUpd)) {
Rcl::Db::OpenMode mode = rdonly ? Rcl::Db::DbRO :
resetbefore ? Rcl::Db::DbTrunc : Rcl::Db::DbUpd;
if (!m_db.open(m_dbdir, mode)) {
LOGERR(("DbIndexer: error opening database in %s\n", m_dbdir.c_str()));
return false;
}
@@ -177,7 +179,7 @@ bool DbIndexer::init(bool resetbefore)
bool DbIndexer::createStemDb(const string &lang)
{
if (!init())
if (!init(false, true))
return false;
return m_db.createStemDb(lang);
}
@@ -188,7 +190,12 @@ bool DbIndexer::createAspellDict()
{
LOGDEB2(("DbIndexer::createAspellDict()\n"));
#ifdef RCL_USE_ASPELL
if (!init())
bool noaspell = false;
m_config->getConfParam("noaspell", &noaspell);
if (noaspell)
return true;
if (!init(false, true))
return false;
Aspell aspell(m_config);
string reason;
+2 -2
View File
@@ -16,7 +16,7 @@
*/
#ifndef _INDEXER_H_INCLUDED_
#define _INDEXER_H_INCLUDED_
/* @(#$Id: indexer.h,v 1.21 2006-10-24 14:28:38 dockes Exp $ (C) 2004 J.F.Dockes */
/* @(#$Id: indexer.h,v 1.22 2006-11-30 13:38:44 dockes Exp $ (C) 2004 J.F.Dockes */
#include <string>
#include <list>
@@ -144,7 +144,7 @@ class DbIndexer : public FsTreeWalkerCB {
string m_tmpdir;
DbIxStatusUpdater *m_updater;
bool init(bool rst = false);
bool init(bool rst = false, bool rdonly = false);
};
/** Helper methods in recollindex.cpp for initial checks/setup to index