[Lxr-commits] CVS: lxr INSTALL,1.13,1.14 find,1.19,1.20 genxref,1.32,1.33
Brought to you by:
ajlittoz
From: Dave B. <bro...@us...> - 2004-07-19 17:56:52
|
Update of /cvsroot/lxr/lxr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12810 Modified Files: INSTALL find genxref Log Message: fixes for glimpse Index: INSTALL =================================================================== RCS file: /cvsroot/lxr/lxr/INSTALL,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- INSTALL 15 Jul 2004 15:18:20 -0000 1.13 +++ INSTALL 19 Jul 2004 17:56:43 -0000 1.14 @@ -82,6 +82,7 @@ If you have glimpse installed, you should set 'glimpsebin' => '/path/to/your/glimpse/executable' + 'glimpseindex' => '/path/to/your/glimpseindex/executable' If you have swish-e installed, you should set @@ -152,34 +153,8 @@ Using Glimpse with LXR -------------------------------- -Create a directory in your LXR directory called glimpse - - mkdir /usr/local/lxr/glimpse - -If you are using CVS, checkout a copy of your project in the -LXR directory, for example - - cd /usr/local/lxr - cvs checkout my_project - -otherwise just use the path to your project instead in the -example below - - find /usr/local/lxr/my_project/ -name *.java | - glimpseindex -H /usr/local/lxr/glimpse -o -F - -Be sure that the glimpse indexes are readable by the user -that Apache is running as. You can do - - chmod a+x /usr/local/lxr/glimpse/.* - -Now edit lxr.conf again and add the following variable for -the URL section that you configured earlier - - 'strip' => '/usr/local/lxr/sikasem' - -This munges the output of glimpse so that you can go straight -to the file that contains a match for a search term. +Create a directory for the swish index files to go in, and put the +path of this directory in the 'glimpsedir' variable. Generate index. --------------- Index: find =================================================================== RCS file: /cvsroot/lxr/lxr/find,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- find 15 Jul 2004 15:29:35 -0000 1.19 +++ find 19 Jul 2004 17:56:43 -0000 1.20 @@ -64,7 +64,7 @@ my @ret; if ($searchtext ne "") { - my $sourceroot = $config->sourceroot; + my $sourceroot = $config->sourceroot . '/' . $release . '/'; while(my $file = <$FILELISTING>) { chomp $file; $file =~ s/^$sourceroot//; @@ -115,7 +115,7 @@ &warning("Version '$release' has not been indexed and is unavailable for searching<br>Could not open ".$config->swishdir."/$release.filenames."); return; } - } elsif ($config->glimpsedir and $config->glimpseindex) { + } elsif ($config->glimpsedir and $config->glimpsebin) { unless ($FILELISTING = new IO::File($config->glimpsedir."/".$release."/.glimpse_filenames")) { &warning("Version '$release' has not been indexed and is unavailable for searching<br>Could not open ".$config->glimpsedir."/$release/.glimpse_filenames."); return; Index: genxref =================================================================== RCS file: /cvsroot/lxr/lxr/genxref,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- genxref 15 Jul 2004 20:29:56 -0000 1.32 +++ genxref 19 Jul 2004 17:56:43 -0000 1.33 @@ -148,10 +148,11 @@ my ($release) = @_; my $string; - if ($config->glimpsebin and $config->glimpseindex) { + if ($config->glimpsedir and $config->glimpseindex) { # Make sure the directory that the glimpse results go into # already exists as glimpse won't work if the directory does # not exist + die $config->glimpsedir . " does not exist" unless -d $config->glimpsedir; $string = $config->glimpsedir."/".$release; mkdir $string; system("chmod 755 $string"); @@ -172,6 +173,7 @@ if ($config->swishdir and $config->swishindex) { my $swish = new IO::Handle; + die $config->swishdir . " does not exist" unless -d $config->swishdir; my $filelist = new IO::File $config->swishdir."/$release.filenames", "w" or die "can't open $release.filenames for writing"; # execute swish, as a pipe we can write to |