add followLinks option
This commit is contained in:
+10
-1
@@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.61 2007-08-28 08:12:58 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.62 2007-08-30 09:01:52 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -97,6 +97,15 @@ bool DbIndexer::indexDb(bool resetbefore, list<string> *topdirs)
|
||||
// Set the current directory in config so that subsequent
|
||||
// getConfParams() will get local values
|
||||
m_config->setKeyDir(*it);
|
||||
|
||||
// Adjust the "follow symlinks" option
|
||||
bool follow;
|
||||
if (m_config->getConfParam("followLinks", &follow) && follow) {
|
||||
m_walker.setOpts(FsTreeWalker::FtwFollow);
|
||||
} else {
|
||||
m_walker.setOpts(FsTreeWalker::FtwOptNone);
|
||||
}
|
||||
|
||||
int abslen;
|
||||
if (m_config->getConfParam("idxabsmlen", &abslen))
|
||||
m_db.setAbstractParams(abslen, -1, -1);
|
||||
|
||||
+3
-3
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
#ifndef _INDEXER_H_INCLUDED_
|
||||
#define _INDEXER_H_INCLUDED_
|
||||
/* @(#$Id: indexer.h,v 1.24 2007-07-10 09:23:28 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
/* @(#$Id: indexer.h,v 1.25 2007-08-30 09:01:52 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
@@ -96,8 +96,8 @@ class DbIndexer : public FsTreeWalkerCB {
|
||||
const string &dbd, // Place where the db lives
|
||||
DbIxStatusUpdater *updfunc = 0 // status updater callback
|
||||
)
|
||||
: m_config(cnf), m_dbdir(dbd), m_updater(updfunc) {
|
||||
}
|
||||
: m_config(cnf), m_dbdir(dbd), m_updater(updfunc)
|
||||
{}
|
||||
|
||||
virtual ~DbIndexer();
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "autoconfig.h"
|
||||
#ifdef RCL_MONITOR
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: rclmonrcv.cpp,v 1.12 2007-07-12 10:53:07 dockes Exp $ (C) 2006 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: rclmonrcv.cpp,v 1.13 2007-08-30 09:01:52 dockes Exp $ (C) 2006 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -134,6 +134,14 @@ void *rclMonRcvRun(void *q)
|
||||
WalkCB walkcb(queue->getConfig(), mon, queue);
|
||||
for (list<string>::iterator it = tdl.begin(); it != tdl.end(); it++) {
|
||||
queue->getConfig()->setKeyDir(*it);
|
||||
// Adjust the follow symlinks options
|
||||
bool follow;
|
||||
if (queue->getConfig()->getConfParam("followLinks", &follow) &&
|
||||
follow) {
|
||||
walker.setOpts(FsTreeWalker::FtwFollow);
|
||||
} else {
|
||||
walker.setOpts(FsTreeWalker::FtwOptNone);
|
||||
}
|
||||
// Adjust the skipped names according to config
|
||||
walker.setSkippedNames(queue->getConfig()->getSkippedNames());
|
||||
// Add the dbdir to skipped paths. Note that adding the dbdir
|
||||
|
||||
Reference in New Issue
Block a user