|
a/src/common/rclconfig.cpp |
|
b/src/common/rclconfig.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid[] = "@(#$Id: rclconfig.cpp,v 1.40 2006-12-20 13:12:49 dockes Exp $ (C) 2004 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: rclconfig.cpp,v 1.41 2007-02-02 10:12:58 dockes Exp $ (C) 2004 J.F.Dockes";
|
3 |
#endif
|
3 |
#endif
|
4 |
/*
|
4 |
/*
|
5 |
* This program is free software; you can redistribute it and/or modify
|
5 |
* This program is free software; you can redistribute it and/or modify
|
6 |
* it under the terms of the GNU General Public License as published by
|
6 |
* it under the terms of the GNU General Public License as published by
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
|
... |
|
... |
434 |
LOGDEB1(("Dbdir not abs, catting with confdir\n"));
|
434 |
LOGDEB1(("Dbdir not abs, catting with confdir\n"));
|
435 |
dbdir = path_cat(m_confdir, dbdir);
|
435 |
dbdir = path_cat(m_confdir, dbdir);
|
436 |
}
|
436 |
}
|
437 |
}
|
437 |
}
|
438 |
LOGDEB1(("RclConfig::getDbDir: dbdir: [%s]\n", dbdir.c_str()));
|
438 |
LOGDEB1(("RclConfig::getDbDir: dbdir: [%s]\n", dbdir.c_str()));
|
439 |
return dbdir;
|
439 |
return path_canon(dbdir);
|
440 |
}
|
440 |
}
|
441 |
|
441 |
|
442 |
list<string> RclConfig::getSkippedNames()
|
442 |
list<string> RclConfig::getSkippedNames()
|
443 |
{
|
443 |
{
|
444 |
list<string> skpl;
|
444 |
list<string> skpl;
|
445 |
string skipped;
|
445 |
string skipped;
|
446 |
if (getConfParam("skippedNames", skipped)) {
|
446 |
if (getConfParam("skippedNames", skipped)) {
|
447 |
stringToStrings(skipped, skpl);
|
447 |
stringToStrings(skipped, skpl);
|
448 |
}
|
448 |
}
|
449 |
// If current keydir is dbdir's ancestor, add dbdir name to skipped
|
449 |
return skpl;
|
450 |
// This is mainly for the real-time monitor that will otherwise go
|
450 |
}
|
451 |
// into a loop
|
451 |
|
452 |
// We'd prefer to do it for the direct ancestor only, but getSkippedNames()
|
452 |
list<string> RclConfig::getSkippedPaths()
|
453 |
// is only called for the topdirs, so this doesn't work
|
453 |
{
|
454 |
string kd = path_canon(getKeyDir());
|
454 |
list<string> skpl;
|
455 |
string dbd = path_canon(getDbDir());
|
455 |
string skipped;
|
456 |
if (dbd.find(kd) == 0) {
|
456 |
if (getConfParam("skippedPaths", skipped)) {
|
457 |
skpl.push_back(path_getsimple(dbd));
|
457 |
stringToStrings(skipped, skpl);
|
458 |
}
|
458 |
}
|
|
|
459 |
// Always add the dbdir and confdir to the skipped paths
|
|
|
460 |
skpl.push_back(getDbDir());
|
|
|
461 |
skpl.push_back(getConfDir());
|
|
|
462 |
for (list<string>::iterator it = skpl.begin(); it != skpl.end(); it++) {
|
|
|
463 |
*it = path_tildexpand(*it);
|
|
|
464 |
*it = path_canon(*it);
|
|
|
465 |
}
|
|
|
466 |
skpl.sort();
|
|
|
467 |
skpl.unique();
|
|
|
468 |
return skpl;
|
|
|
469 |
}
|
|
|
470 |
|
|
|
471 |
list<string> RclConfig::getDaemSkippedPaths()
|
|
|
472 |
{
|
|
|
473 |
list<string> skpl = getSkippedPaths();
|
|
|
474 |
|
|
|
475 |
list<string> dskpl;
|
|
|
476 |
string skipped;
|
|
|
477 |
if (getConfParam("daemSkippedPaths", skipped)) {
|
|
|
478 |
stringToStrings(skipped, dskpl);
|
|
|
479 |
}
|
|
|
480 |
|
|
|
481 |
for (list<string>::iterator it = dskpl.begin(); it != dskpl.end(); it++) {
|
|
|
482 |
*it = path_tildexpand(*it);
|
|
|
483 |
*it = path_canon(*it);
|
|
|
484 |
}
|
|
|
485 |
dskpl.sort();
|
|
|
486 |
|
|
|
487 |
skpl.merge(dskpl);
|
|
|
488 |
skpl.unique();
|
459 |
return skpl;
|
489 |
return skpl;
|
460 |
}
|
490 |
}
|
461 |
|
491 |
|
462 |
|
492 |
|
463 |
// Look up an executable filter. We look in $RECOLL_FILTERSDIR,
|
493 |
// Look up an executable filter. We look in $RECOLL_FILTERSDIR,
|