dont autocreate config specified with -c or RECOLL_CONFDIR
This commit is contained in:
parent
d1772cad7c
commit
75f1df098f
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: rclconfig.cpp,v 1.42 2007-02-06 14:16:43 dockes Exp $ (C) 2004 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: rclconfig.cpp,v 1.43 2007-02-07 17:17:11 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -63,6 +63,10 @@ RclConfig::RclConfig(const string *argcnf)
|
|||||||
m_datadir = cdatadir;
|
m_datadir = cdatadir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We only do the automatic configuration creation thing for the default
|
||||||
|
// config dir, not if it was specified through -c or RECOLL_CONFDIR
|
||||||
|
bool autoconfdir = false;
|
||||||
|
|
||||||
// Command line config name overrides environment
|
// Command line config name overrides environment
|
||||||
if (argcnf && !argcnf->empty()) {
|
if (argcnf && !argcnf->empty()) {
|
||||||
m_confdir = path_absolute(*argcnf);
|
m_confdir = path_absolute(*argcnf);
|
||||||
@ -76,10 +80,23 @@ RclConfig::RclConfig(const string *argcnf)
|
|||||||
if (cp) {
|
if (cp) {
|
||||||
m_confdir = cp;
|
m_confdir = cp;
|
||||||
} else {
|
} else {
|
||||||
|
autoconfdir = true;
|
||||||
m_confdir = path_home();
|
m_confdir = path_home();
|
||||||
m_confdir += ".recoll/";
|
m_confdir += ".recoll/";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!autoconfdir) {
|
||||||
|
// We want a recoll.conf file to exist in this case to avoid
|
||||||
|
// creating indexes all over the place
|
||||||
|
string conffile = path_cat(m_confdir, "recoll.conf");
|
||||||
|
if (access(conffile.c_str(), 0) < 0) {
|
||||||
|
m_reason = "Explicitely specified configuration must exist"
|
||||||
|
" (won't be automatically created)";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (access(m_confdir.c_str(), 0) < 0) {
|
if (access(m_confdir.c_str(), 0) < 0) {
|
||||||
if (!initUserConfig())
|
if (!initUserConfig())
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
Dockes</holder>
|
Dockes</holder>
|
||||||
</copyright>
|
</copyright>
|
||||||
|
|
||||||
<releaseinfo>$Id: usermanual.sgml,v 1.38 2007-02-02 10:27:44 dockes Exp $</releaseinfo>
|
<releaseinfo>$Id: usermanual.sgml,v 1.39 2007-02-07 17:17:11 dockes Exp $</releaseinfo>
|
||||||
|
|
||||||
<abstract>
|
<abstract>
|
||||||
<para>This document introduces full text search notions
|
<para>This document introduces full text search notions
|
||||||
@ -1595,12 +1595,16 @@ fvwm
|
|||||||
|
|
||||||
<para>If the <filename>.recoll</filename> directory does not
|
<para>If the <filename>.recoll</filename> directory does not
|
||||||
exist when <command>recoll</command> or
|
exist when <command>recoll</command> or
|
||||||
<command>recollindex</command> are started, it
|
<command>recollindex</command> are started, it will be created
|
||||||
will be created with a set of empty configuration files.
|
with a set of empty configuration files.
|
||||||
<command>recoll</command> will give you a
|
<command>recoll</command> will give you a chance to edit the
|
||||||
chance to edit the configuration file before starting
|
configuration file before starting
|
||||||
indexing. <command>recollindex</command> will
|
indexing. <command>recollindex</command> will proceed
|
||||||
proceed immediately.</para>
|
immediately. To avoid mistakes, the automatic directory
|
||||||
|
creation will only occur for the
|
||||||
|
default location, not if <literal>-c</literal> or
|
||||||
|
<literal>RECOLL_CONFDIR</literal> were used (in the latter
|
||||||
|
cases, you will have to create the directory).</para>
|
||||||
|
|
||||||
|
|
||||||
<para>All configuration files share the same format. For
|
<para>All configuration files share the same format. For
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user