Merge branch 'master' of https://framagit.org/medoc92/recoll
This commit is contained in:
@@ -125,7 +125,7 @@
|
||||
#define PACKAGE_NAME "Recoll"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "Recoll 1.31.6"
|
||||
#define PACKAGE_STRING "Recoll 1.32.0"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "recoll"
|
||||
@@ -134,7 +134,7 @@
|
||||
#define PACKAGE_URL ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "1.31.6"
|
||||
#define PACKAGE_VERSION "1.32.0"
|
||||
|
||||
/* putenv parameter is const */
|
||||
/* #undef PUTENV_ARG_CONST */
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
#define PACKAGE_NAME "Recoll"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "Recoll 1.31.6"
|
||||
#define PACKAGE_STRING "Recoll 1.32.0"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "recoll"
|
||||
@@ -127,13 +127,13 @@
|
||||
#define PACKAGE_URL ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "1.31.6"
|
||||
#define PACKAGE_VERSION "1.32.0"
|
||||
|
||||
/* putenv parameter is const */
|
||||
/* #undef PUTENV_ARG_CONST */
|
||||
|
||||
/* Real time monitoring option */
|
||||
#undef RCL_MONITOR
|
||||
#define RCL_MONITOR 1
|
||||
|
||||
/* Split camelCase words */
|
||||
/* #undef RCL_SPLIT_CAMELCASE */
|
||||
|
||||
+37
-22
@@ -58,6 +58,16 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
// Naming the directory for platform-specific default config files, overriding the top-level ones
|
||||
// E.g. /usr/share/recoll/examples/windows
|
||||
#ifdef _WIN32
|
||||
static const string confsysdir{"windows"};
|
||||
#elif defined(_APPLE__)
|
||||
static const string confsysdir{"macos"};
|
||||
#else
|
||||
static const string confsysdir;
|
||||
#endif
|
||||
|
||||
// Static, logically const, RclConfig members or module static
|
||||
// variables are initialized once from the first object build during
|
||||
// process initialization.
|
||||
@@ -303,8 +313,15 @@ RclConfig::RclConfig(const string *argcnf)
|
||||
m_cdirs.push_back(cp);
|
||||
}
|
||||
|
||||
// Base/installation config
|
||||
m_cdirs.push_back(path_cat(m_datadir, "examples"));
|
||||
// Base/installation config, and its platform-specific overrides
|
||||
std::string defaultsdir = path_cat(m_datadir, "examples");
|
||||
if (!confsysdir.empty()) {
|
||||
std::string sdir = path_cat(defaultsdir, confsysdir);
|
||||
if (path_isdir(sdir)) {
|
||||
m_cdirs.push_back(sdir);
|
||||
}
|
||||
}
|
||||
m_cdirs.push_back(defaultsdir);
|
||||
|
||||
string cnferrloc;
|
||||
for (const auto& dir : m_cdirs) {
|
||||
@@ -376,6 +393,7 @@ bool RclConfig::updateMainConfig()
|
||||
{
|
||||
ConfStack<ConfTree> *newconf = new ConfStack<ConfTree>("recoll.conf", m_cdirs, true);
|
||||
if (newconf == 0 || !newconf->ok()) {
|
||||
std::cerr << "updateMainConfig: new Confstack not ok\n";
|
||||
if (m_conf)
|
||||
return false;
|
||||
m_ok = false;
|
||||
@@ -1633,6 +1651,7 @@ vector<string> RclConfig::getDaemSkippedPaths() const
|
||||
// and filtersdir from the config file to the PATH, then use execmd::which()
|
||||
string RclConfig::findFilter(const string &icmd) const
|
||||
{
|
||||
LOGDEB2("findFilter: " << icmd << "\n");
|
||||
// If the path is absolute, this is it
|
||||
if (path_isabsolute(icmd))
|
||||
return icmd;
|
||||
@@ -1680,13 +1699,19 @@ bool RclConfig::processFilterCmd(std::vector<std::string>& cmd) const
|
||||
LOGDEB0("processFilterCmd: in: " << stringsToString(cmd) << "\n");
|
||||
auto it = cmd.begin();
|
||||
|
||||
// Special-case python and perl on windows: we need to also locate the
|
||||
// first argument which is the script name "python somescript.py".
|
||||
// On Unix, thanks to #!, we usually just run "somescript.py", but need
|
||||
// the same change if we ever want to use the same cmd line as windows
|
||||
bool hasinterp = !stringlowercmp("python", *it) ||
|
||||
!stringlowercmp("perl", *it);
|
||||
|
||||
#ifdef _WIN32
|
||||
// Special-case interpreters on windows: we used to have an additional 1st argument "python" in
|
||||
// mimeconf, but we now rely on the .py extension for better sharing of mimeconf.
|
||||
std::string ext = path_suffix(*it);
|
||||
if ("py" == ext) {
|
||||
it = cmd.insert(it, findFilter("python"));
|
||||
it++;
|
||||
} else if ("pl" == ext) {
|
||||
it = cmd.insert(it, findFilter("perl"));
|
||||
it++;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Note that, if the cmd vector size is 1, post-incrementing the
|
||||
// iterator in the following statement, which works on x86, leads
|
||||
// to a crash on ARM with gcc 6 and 8 (at least), which does not
|
||||
@@ -1694,25 +1719,15 @@ bool RclConfig::processFilterCmd(std::vector<std::string>& cmd) const
|
||||
// whatever... We do it later then.
|
||||
*it = findFilter(*it);
|
||||
|
||||
if (hasinterp) {
|
||||
if (cmd.size() < 2) {
|
||||
LOGERR("processFilterCmd: python/perl cmd: no script?. [" <<
|
||||
stringsToString(cmd) << "]\n");
|
||||
return false;
|
||||
} else {
|
||||
++it;
|
||||
*it = findFilter(*it);
|
||||
}
|
||||
}
|
||||
LOGDEB0("processFilterCmd: out: " << stringsToString(cmd) << "\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RclConfig::pythonCmd(const std::string& scriptname,
|
||||
std::vector<std::string>& cmd) const
|
||||
// This now does nothing more than processFilterCmd (after we changed to relying on the py extension)
|
||||
bool RclConfig::pythonCmd(const std::string& scriptname, std::vector<std::string>& cmd) const
|
||||
{
|
||||
#ifdef _WIN32
|
||||
cmd = {"python", scriptname};
|
||||
cmd = {scriptname};
|
||||
#else
|
||||
cmd = {scriptname};
|
||||
#endif
|
||||
|
||||
+14
-12
@@ -596,6 +596,7 @@ bool TextSplit::text_to_words(const string &in)
|
||||
clearsplitstate();
|
||||
|
||||
bool pagepending = false;
|
||||
bool nlpending = false;
|
||||
bool softhyphenpending = false;
|
||||
|
||||
// Running count of non-alphanum chars. Reset when we see one;
|
||||
@@ -705,6 +706,10 @@ bool TextSplit::text_to_words(const string &in)
|
||||
pagepending = false;
|
||||
newpage(m_wordpos);
|
||||
}
|
||||
if (nlpending) {
|
||||
nlpending = false;
|
||||
newline(m_wordpos);
|
||||
}
|
||||
break;
|
||||
|
||||
case WILD:
|
||||
@@ -745,6 +750,12 @@ bool TextSplit::text_to_words(const string &in)
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// Note about dangling hyphens: we always strip '-' found before whitespace,
|
||||
// even before a newline, then generate two terms, before and after the line
|
||||
// break. We have no way to know if '-' is there because a word was broken by
|
||||
// justification or if it was part of an actual compound word (would need a
|
||||
// dictionary to check). As soft-hyphen *should* be used if the '-' is not part
|
||||
// of the text.
|
||||
if (nextc == -1 || isvisiblewhite(nextc)) {
|
||||
goto SPACE;
|
||||
}
|
||||
@@ -844,19 +855,10 @@ bool TextSplit::text_to_words(const string &in)
|
||||
break;
|
||||
|
||||
case '\n':
|
||||
nlpending = true;
|
||||
/* FALLTHROUGH */
|
||||
case '\r':
|
||||
if (m_span.length() && *m_span.rbegin() == '-') {
|
||||
// if '-' is the last char before end of line, we
|
||||
// strip it. We have no way to know if this is added
|
||||
// because of the line split or if it was part of an
|
||||
// actual compound word (would need a dictionary to
|
||||
// check). As soft-hyphen *should* be used if the '-'
|
||||
// is not part of the text, it is better to properly
|
||||
// process a real compound word, and produce wrong
|
||||
// output from wrong text. The word-emitting routine
|
||||
// will strip the trailing '-'.
|
||||
goto SPACE;
|
||||
} else if (softhyphenpending) {
|
||||
if (softhyphenpending) {
|
||||
// Don't reset soft-hyphen
|
||||
continue;
|
||||
} else {
|
||||
|
||||
@@ -73,6 +73,9 @@ public:
|
||||
* just don't know about pages. */
|
||||
virtual void newpage(int /*pos*/) {}
|
||||
|
||||
/** Called when we encounter newline \n 0x0a. Override to use the event. */
|
||||
virtual void newline(int /*pos*/) {}
|
||||
|
||||
// Static utility functions:
|
||||
|
||||
/** Count words in string, as the splitter would generate them */
|
||||
|
||||
Reference in New Issue
Block a user