From aed54ee6ee864c7f741e2133f20956da38f8a239 Mon Sep 17 00:00:00 2001
From: dockes
Date: Tue, 5 Jan 2010 15:00:18 +0000
Subject: [PATCH] 1.13 tests txt mods + solaris port (FNM_LEADING_DIR)
---
src/utils/closefrom.cpp | 3 +++
src/utils/fstreewalk.cpp | 36 +++++++++++++++++++++++++-----------
src/utils/fstreewalk.h | 2 +-
tests/Maildir/Maildir.txt | 2 +-
tests/andor/andor.sh | 2 +-
tests/andor/andor.txt | 6 +++---
tests/cjk/cjk.sh | 4 ++--
tests/cjk/cjk.txt | 6 +++---
tests/mail/mail.txt | 4 ++--
tests/msword/msword.txt | 3 ++-
tests/txt/txt.txt | 4 ++--
website/download.html | 20 +++++++-------------
12 files changed, 52 insertions(+), 40 deletions(-)
diff --git a/src/utils/closefrom.cpp b/src/utils/closefrom.cpp
index 42a1b273..472985c0 100644
--- a/src/utils/closefrom.cpp
+++ b/src/utils/closefrom.cpp
@@ -143,6 +143,9 @@ void libclf_setmaxfd(int max)
closefrom_maxfd = max;
}
+#ifdef sun
+#include
+#endif
int libclf_closefrom(int fd0)
{
int i, maxfd = closefrom_maxfd;
diff --git a/src/utils/fstreewalk.cpp b/src/utils/fstreewalk.cpp
index 15973d3e..3471b3f1 100644
--- a/src/utils/fstreewalk.cpp
+++ b/src/utils/fstreewalk.cpp
@@ -125,20 +125,29 @@ bool FsTreeWalker::setSkippedPaths(const list &paths)
*it = path_canon(*it);
return true;
}
-bool FsTreeWalker::inSkippedPaths(const string& path)
+bool FsTreeWalker::inSkippedPaths(const string& path, bool ckparents)
{
+ int fnmflags = FNM_PATHNAME;
+#ifdef FNM_LEADING_DIR
+ if (ckparents)
+ fnmflags |= FNM_LEADING_DIR;
+#endif
list::const_iterator it;
for (it = data->skippedPaths.begin();
it != data->skippedPaths.end(); it++) {
- // If we find a system where FNM_LEADING_DIR is undefined (its
- // unposixy), will have to do this for all ascendant paths up
- // to the topdir. We'll then have a constructor option because
- // this is only useful when called externally. When used
- // internally, we don't descend in skipped paths, and so don't
- // need FNM_LEADING_DIR
- if (fnmatch(it->c_str(), path.c_str(), FNM_PATHNAME |
- FNM_LEADING_DIR) == 0)
- return true;
+#ifndef FNM_LEADING_DIR
+ if (ckparents) {
+ string mpath = path;
+ while (mpath.length() > 2) {
+ if (fnmatch(it->c_str(), mpath.c_str(), fnmflags) == 0)
+ return true;
+ mpath = path_getfather(mpath);
+ }
+ } else
+#endif /* FNM_LEADING_DIR */
+ if (fnmatch(it->c_str(), path.c_str(), fnmflags) == 0) {
+ return true;
+ }
}
return false;
}
@@ -217,7 +226,12 @@ FsTreeWalker::Status FsTreeWalker::iwalk(const string &top,
continue;
}
if (!data->skippedPaths.empty()) {
- if (inSkippedPaths(fn))
+ // We do not check the ancestors. This means that you can have
+ // a topdirs member under a skippedPath, to index a portion of
+ // an ignored area. This is the way it had always worked, but
+ // this was broken by 1.13.00 and the systematic use of
+ // FNM_LEADING_DIR
+ if (inSkippedPaths(fn, false))
goto skip;
}
diff --git a/src/utils/fstreewalk.h b/src/utils/fstreewalk.h
index e7116aa2..2c4c6d0a 100644
--- a/src/utils/fstreewalk.h
+++ b/src/utils/fstreewalk.h
@@ -81,7 +81,7 @@ class FsTreeWalker {
/** Test if path/name should be skipped. This can be used independantly of
* an actual tree walk */
- bool inSkippedPaths(const string& path);
+ bool inSkippedPaths(const string& path, bool ckparents = true);
bool inSkippedNames(const string& name);
private:
diff --git a/tests/Maildir/Maildir.txt b/tests/Maildir/Maildir.txt
index 334fd3e7..6d0c75ef 100644
--- a/tests/Maildir/Maildir.txt
+++ b/tests/Maildir/Maildir.txt
@@ -1 +1 @@
-FreqFor maildir_uniquexxx : 692
+FreqFor maildir_uniquexxx : 691
diff --git a/tests/andor/andor.sh b/tests/andor/andor.sh
index cf84f017..3b15b55b 100755
--- a/tests/andor/andor.sh
+++ b/tests/andor/andor.sh
@@ -5,7 +5,7 @@ topdir=`dirname $0`/..
initvariables $0
-recollq 'Beatles OR Lennon Live OR Unplugged' 2> $mystderr |
+recollq 'andorhuniique Beatles OR Lennon Live OR Unplugged' 2> $mystderr |
egrep -v '^Recoll query: ' > $mystdout
diff -w ${myname}.txt $mystdout > $mydiffs 2>&1
diff --git a/tests/andor/andor.txt b/tests/andor/andor.txt
index 893d3a56..403db319 100644
--- a/tests/andor/andor.txt
+++ b/tests/andor/andor.txt
@@ -1,3 +1,3 @@
-2 results
-text/plain [file:///home/dockes/projets/fulltext/testrecoll/andor/bu.txt] [bu.txt] 18 bytes
-text/plain [file:///home/dockes/projets/fulltext/testrecoll/andor/leli.txt] [leli.txt] 12 bytes
+2 results
+text/plain [file:///home/dockes/projets/fulltext/testrecoll/andor/bu.txt] [bu.txt] 32 bytes
+text/plain [file:///home/dockes/projets/fulltext/testrecoll/andor/leli.txt] [leli.txt] 26 bytes
diff --git a/tests/cjk/cjk.sh b/tests/cjk/cjk.sh
index 68dbf282..3572e6d3 100755
--- a/tests/cjk/cjk.sh
+++ b/tests/cjk/cjk.sh
@@ -8,9 +8,9 @@ initvariables $0
# We need an UTF-8 locale here for recollq arg transcoding
LANG=en_US.UTF-8
export LANG
-recollq 'まず' 2> $mystderr |
+recollq 'keyword:ckjtsthuniique まず' 2> $mystderr |
egrep -v '^Recoll query: ' > $mystdout
-recollq 'ます' 2>> $mystderr |
+recollq 'keyword:ckjtsthuniique ます' 2>> $mystderr |
egrep -v '^Recoll query: ' >> $mystdout
diff --git a/tests/cjk/cjk.txt b/tests/cjk/cjk.txt
index ce48721f..5fe08490 100644
--- a/tests/cjk/cjk.txt
+++ b/tests/cjk/cjk.txt
@@ -1,9 +1,9 @@
3 results
+message/rfc822 [file:///home/dockes/projets/fulltext/testrecoll/cjk/mbox] [Re: recoll sidux and -ja] 68397 bytes
text/html [file:///home/dockes/projets/fulltext/testrecoll/cjk/mazu.html] [mazu.html] 260 bytes
text/html [file:///home/dockes/projets/fulltext/testrecoll/cjk/japanese.html] [japanese.html] 1403 bytes
-message/rfc822 [file:///home/dockes/projets/fulltext/testrecoll/cjk/mbox] [Re: recoll sidux and -ja] 68397 bytes
4 results
-text/html [file:///home/dockes/projets/fulltext/testrecoll/cjk/term-konsole-ja.htm] [sidux Manuals - The Terminal or Konsole] 34269 bytes
+message/rfc822 [file:///home/dockes/projets/fulltext/testrecoll/cjk/mbox] [Re: recoll sidux and -ja] 68397 bytes
text/html [file:///home/dockes/projets/fulltext/testrecoll/cjk/masu.html] [masu.html] 215 bytes
text/html [file:///home/dockes/projets/fulltext/testrecoll/cjk/japanese.html] [japanese.html] 1403 bytes
-message/rfc822 [file:///home/dockes/projets/fulltext/testrecoll/cjk/mbox] [Re: recoll sidux and -ja] 68397 bytes
+text/html [file:///home/dockes/projets/fulltext/testrecoll/cjk/term-konsole-ja.htm] [sidux Manuals - The Terminal or Konsole] 34269 bytes
diff --git a/tests/mail/mail.txt b/tests/mail/mail.txt
index 86a4ab99..7f56f126 100644
--- a/tests/mail/mail.txt
+++ b/tests/mail/mail.txt
@@ -1,6 +1,6 @@
2 results
-message/rfc822 [file:///home/dockes/projets/fulltext/testrecoll/mail/outmail] [Re: CDNow, mkfichcom.tcl and "] 2248233 bytes
-message/rfc822 [file:///home/dockes/projets/fulltext/testrecoll/mail/outmail] [Home Ip] 2248233 bytes
+message/rfc822 [file:///home/dockes/projets/fulltext/testrecoll/mail/outmail] [Re: CDNow, mkfichcom.tcl and "] 2248254 bytes
+message/rfc822 [file:///home/dockes/projets/fulltext/testrecoll/mail/outmail] [Home Ip] 2248254 bytes
1 results
message/rfc822 [file:///home/dockes/projets/fulltext/testrecoll/mail/BadHtmlInMail] [Prochaine rando] 3637 bytes
1 results
diff --git a/tests/msword/msword.txt b/tests/msword/msword.txt
index 96f3a889..83d382d1 100644
--- a/tests/msword/msword.txt
+++ b/tests/msword/msword.txt
@@ -1,2 +1,3 @@
-1 results
+2 results
application/msword [file:///home/dockes/projets/fulltext/testrecoll/msword/programme.doc] [programme.doc] 58880 bytes
+application/msword [file:///home/dockes/projets/fulltext/testrecoll/zip/misc.zip] [misc.zip] 168155 bytes
diff --git a/tests/txt/txt.txt b/tests/txt/txt.txt
index 1ce7c9ca..188294ac 100644
--- a/tests/txt/txt.txt
+++ b/tests/txt/txt.txt
@@ -1,3 +1,3 @@
-2 results
-text/plain [file:///home/dockes/projets/fulltext/testrecoll/txt/liste.txt] [liste.txt] 1165 bytes
+2 results
+text/plain [file:///home/dockes/projets/fulltext/testrecoll/txt/liste.txt] [liste.txt] 1182 bytes
text/plain [file:///home/dockes/projets/fulltext/testrecoll/txt/liste1.txt] [liste1.txt] 893 bytes
diff --git a/website/download.html b/website/download.html
index 2cab1b24..fccab036 100644
--- a/website/download.html
+++ b/website/download.html
@@ -126,6 +126,10 @@
Changes. Bugs.
+ For building on Solaris (at least 5.8), you need to apply
+ this patch to the
+ Recoll source.
+
In order to build Recoll from source, you will need to install
the Xapian core development libraries. You will find source and binary
packages on the
@@ -289,21 +293,11 @@ gpg --export --armor A0735AD0 | sudo apt-key add -
Note to Solaris users: you need to perform the initial
indexing pass with "recollindex", not the recoll GUI indexing
- thread. See errata.
- Also you need a small patch to compile on solaris (version 8 at
- least). In directory utils, you need to
- include <limits.h> in closefrom.cpp
-
-diff -w closefrom.cpp.orig closefrom.cpp
-145a146,148
-> #ifdef sun
-> #include
-> #endif
-
+ thread. See errata.
Solaris 8 SPARC:
-
- recoll-1.12.3-SunOS-5.8.tgz.
+
+ recoll-1.13.00-SunOS-5.8.tgz.
Recoll also builds and runs on Solaris 10, but, given the
situation (2008) of open source packages for Solaris (very old