On my latest svn 14181 I get this message, just below the heading in
TWiki.WebSearch when there is no search term specified:
Could not perform search. Error was: /bin/egrep -i -l -H -- %TOKEN|U% %FILES|F% returned an error
Search works normally though. Seems to be related to an empty search.
develop.twiki.org does not have this error.
My env:
Linux example.com 2.4.21-27.ELsmp #1 SMP Wed Dec 1 21:59:02 EST 2004 i686 i686 i386 GNU/Linux
$TWiki::cfg{RCS}{EgrepCmd} = '/bin/egrep %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%';
$TWiki::cfg{RCS}{FgrepCmd} = '/bin/fgrep %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%';
--
TWiki:Main/PeterThoeny
- 17 Jun 2007
There have been several changes in the search code recently; do you still get it? What is the diff between
WebSearch.txt on d.t.o and on your install?
CC
I am at latest SVN 14244 and still get the error.
--
TWiki:Main.PeterThoeny
- 22 Jun 2007
I was able to reproduce this in a raw checkout. it looks like the status checking code is correct, because grep returns a non-zero exit code for that search. The fix is to avoid feeding a null string to grep (that also banjaxed Native search a while ago, and i wasn't seeing the error because native handles it correctly)
CC
Hmm, there used to be a
"something.Very/unLikelyTo+search-for;-)"
search string default if the search string was empty. Possibly lost in a refactor?
--
TWiki:Main.PeterThoeny
- 23 Jun 2007
No. It fails because it invokes egrep using the formulation for a regex search, and the string default contains regex meta-characters ., + and ). It invokes a regex search because the new wordboundary search mode is enabled. It only blows up with forking search.
It works fine if I change the
$emptySearch
to the null string
''
. Out of interest, what was the idea behind that string? I never understood it. Was it because you used to generate command lines for backtick execution, and without some text there the parameter order would be lost? If so, why didn't you just put quotes around the search string? Or was it because you wanted to be sure there would be no hits for an empty search? In that case, why did you invoke grep for an empty string search at all? it seems to me to be a simple tests to eliminate the search for an empty string in Search.pm.
CC