From: Andre-Littoz <ajl...@us...> - 2013-11-29 16:01:08
|
Update of /cvsroot/lxr/lxr/lib/LXR In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv14033/lib/LXR Modified Files: Config.pm Log Message: Config.pm: avoid testing for free-text search engines with VCSes In multiple-trees context, lxr.conf may describe plain files and VCS-stored trees simultaneously.. One free-text search engine is present but there is no auxiliary directory (for engine internal data) associated with the VCS-tree. This leads to an error in Config.pm _initialize sub. The text for free-text engine (and its environment) is skipped for any VCS-stored tree. Index: Config.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Config.pm,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- Config.pm 8 Nov 2013 14:22:25 -0000 1.59 +++ Config.pm 29 Nov 2013 16:01:05 -0000 1.60 @@ -511,43 +511,44 @@ # Set-up various directories as necessary _ensuredirexists($self->{'tmpdir'}); + if ($self->{'sourceroot'} !~ m/^\w+:/) { # See if there is ambiguity on the free-text search engine - if (exists $self->{'glimpsebin'} && exists $self->{'swishbin'}) { - die "Both Glimpse and Swish have been specified in $confpath.\n" - ."Please choose one of them by commenting out either glimpsebin or swishbin.\n"; - - } elsif (exists $self->{'glimpsebin'}) { - if (!exists($self->{'glimpsedir'})) { - die "Please specify 'glimpsedirbase' or 'glimpsedir' in $confpath\n" - unless exists($self->{'glimpsedirbase'}); - $self->{'glimpsedir'} = $self->{'glimpsedirbase'} +# only when tree is stored in plain files +# since free-text search is not operational with VCSes, + if (exists $self->{'glimpsebin'} && exists $self->{'swishbin'}) { + die "Both Glimpse and Swish have been specified in $confpath.\n" + ."Please choose one of them by commenting out either glimpsebin or swishbin.\n"; + + } elsif (exists $self->{'glimpsebin'}) { + if (!exists($self->{'glimpsedir'})) { + die "Please specify 'glimpsedirbase' or 'glimpsedir' in $confpath\n" + unless exists($self->{'glimpsedirbase'}); + $self->{'glimpsedir'} = $self->{'glimpsedirbase'} + . $self->{'virtroot'} + . ('argument' eq $routing + ? $self->{'treename'} + : '' + ) + ; + } + _ensuredirexists($self->{'glimpsedir'}); + } elsif (exists $self->{'swishbin'}) { + if (!exists($self->{'swishdir'})) { + die "Please specify 'swishdirbase' or 'swishdir' in $confpath\n" + unless exists($self->{'swishdirbase'}); + $self->{'swishdir'} = $self->{'swishdirbase'} . $self->{'virtroot'} . ('argument' eq $routing - ? $self->{'treename'} - : '' - ) + ? $self->{'treename'} + : '' + ) ; + } + _ensuredirexists($self->{'swishdir'}); + } else { + die "Neither Glimpse nor Swish have been specified in $confpath.\n" + ."Please choose one of them by specifing a value for either glimpsebin or swishbin.\n"; } - _ensuredirexists($self->{'glimpsedir'}); - } elsif (exists $self->{'swishbin'}) { - if (!exists($self->{'swishdir'})) { - die "Please specify 'swishdirbase' or 'swishdir' in $confpath\n" - unless exists($self->{'swishdirbase'}); - $self->{'swishdir'} = $self->{'swishdirbase'} - . $self->{'virtroot'} - . ('argument' eq $routing - ? $self->{'treename'} - : '' - ) - ; - } - _ensuredirexists($self->{'swishdir'}); - } else { - # Since free-text search is not operational with VCSes, - # don't complain if not configured. - die "Neither Glimpse nor Swish have been specified in $confpath.\n" - ."Please choose one of them by specifing a value for either glimpsebin or swishbin.\n" - unless $self->{'sourceroot'} =~ m!^[^/]+:! ; } return 1; } |