[Lxr-commits] CVS: lxr genxref,1.65,1.66
Brought to you by:
ajlittoz
From: Andre-Littoz <ajl...@us...> - 2012-12-07 12:27:39
|
Update of /cvsroot/lxr/lxr In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv29670 Modified Files: genxref Log Message: genxref: improve initial environment tests Index: genxref =================================================================== RCS file: /cvsroot/lxr/lxr/genxref,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- genxref 4 Dec 2012 13:47:13 -0000 1.65 +++ genxref 7 Dec 2012 12:27:35 -0000 1.66 @@ -239,6 +239,9 @@ check_tool('glimpseindex', 'glimpseindex', '-V', '0'); $foundswishe = check_tool('swishbin', 'swish-e', '-V', '2.1'); +# The following verifications are a bit "over-kill" +# because there is presently no check on version level +# on glimpse. But that could change in the future. if ($foundglimpse == 0 && $foundswishe == 0) { # No engine defined - propose to go on without print "${VTyellow}Neither 'glimpsebin' nor 'swishbin' defined${VTnorm}\n"; @@ -255,7 +258,18 @@ } elsif ($foundglimpse <= 0 && $foundswishe <= 0) { # Can't use any search engine # (either not found or version too low) - $failure |= 1 + # But check if user disabled free-text search with suggested tip + if ( $foundglimpse < 0 # true has no version + && $config->{'glimpsebin'} =~ m:(^|/)true$: + && $foundswishe == 0 + || $foundswishe < 0 + && $config->{'swishbin'} =~ m:(^|/)true$: + && $foundglimpse == 0 + ) { + # Leave $failure "as is" when user disables search + } else { + $failure |= 1 + } } elsif ($foundglimpse == 1 && $foundswishe <= 1) { # glimpse has been forced, but glimpse is prefered if both print "${VTyellow}Warning:${VTnorm} using existing ${VTbold}glimpse${VTnorm}\n"; @@ -446,7 +460,7 @@ cleanindex($version); } if ($files->isa("LXR::Files::Plain")) { - if ($foundglimpse || $foundswishe) { + if ($foundglimpse > 0 || $foundswishe > 0) { gensearch($version); } else { print STDERR "${VTyellow}Free-text search disabled${VTnorm}\n"; |