perl-docs-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: modperl-docs/src/search swish.cgi
Date Mon, 04 Feb 2002 09:19:39 GMT
stas        02/02/04 01:19:39

  Modified:    src/search swish.cgi
  Log:
  make the search of the swish-e executable more flexible. First
  search in the PATH, then in the current dir.
  
  Revision  Changes    Path
  1.2       +12 -9     modperl-docs/src/search/swish.cgi
  
  Index: swish.cgi
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/search/swish.cgi,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- swish.cgi	30 Jan 2002 06:35:00 -0000	1.1
  +++ swish.cgi	4 Feb 2002 09:19:39 -0000	1.2
  @@ -12,7 +12,7 @@
   #
   #    To display documentation for this program type "perldoc swish.cgi"
   #
  -#    swish.cgi $Revision: 1.1 $ Copyright (C) 2001 Bill Moseley swishscript@hank.org
  +#    swish.cgi $Revision: 1.2 $ Copyright (C) 2001 Bill Moseley swishscript@hank.org
   #    Example CGI program for searching with SWISH-E
   #
   #    This example program will only run under an OS that supports fork().
  @@ -31,7 +31,7 @@
   #
   #    The above lines must remain at the top of this program
   #
  -#    $Id: swish.cgi,v 1.1 2002/01/30 06:35:00 stas Exp $
  +#    $Id: swish.cgi,v 1.2 2002/02/04 09:19:39 stas Exp $
   #
   ####################################################################################
   
  @@ -140,13 +140,18 @@
   
   sub default_config {
   
  +    # make the search of the swish-e executable more flexible. First
  +    # search in the PATH, then in the current dir.
  +    my $exec = `which swish-e`;
  +#warn "found exec: $exec";
  +    chomp $exec;
  +    $exec ||= './swish-e';
  +    die "Cannot find swish-e" unless -x $exec;
   
  -    
       ##### Configuration Parameters #########
   
       #---- This lists all the options, with many commented out ---
       # By default, this config is used -- see the process_request() call below.
  -    
       # You should adjust for your site, and how your swish index was created.
   
       ##>>
  @@ -155,11 +160,10 @@
       ##>>  Send a small example, without all the comments.
   
       # Items beginning with an "x" or "#" are commented out
  -    
  +
       return {
           title           => 'Search our site',  # Title of your choice.
  -        swish_binary    => './swish-e',        # Location of swish-e binary
  -
  +        swish_binary    => $exec,              # Location of swish-e binary
   
           # By default, this script tries to read a config file.  You should probably
           # comment this out if not used save a disk stat
  @@ -1112,7 +1116,6 @@
       $self->swish_command( -x => join( '\t', map { "<$_>" } @properties ) .
'\n' );
       $self->swish_command( -H => 9 );
   
  -
       # Run swish 
       my $fh = gensym;
       my $pid = open( $fh, '-|' );
  @@ -1845,7 +1848,7 @@
   
   =head1 LICENSE
   
  -swish.cgi $Revision: 1.1 $ Copyright (C) 2001 Bill Moseley search@hank.org
  +swish.cgi $Revision: 1.2 $ Copyright (C) 2001 Bill Moseley search@hank.org
   Example CGI program for searching with SWISH-E
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-cvs-help@perl.apache.org


Mime
View raw message