#!/usr/bin/perl -w # run with -v to enable the verbose mode my %opts; use Getopt::Std; getopt('v', \%opts); # does the indexing process # relies on setting of the following env varibles: # # the root of the site, without the trailing / # export MODPERL_SITE='http://localhost/modperl-site' # # the location of the swish-e, we need it to be set explicitly, # because on some machines, more than one version exists, and we need # the 2.1-dev + version # $ENV{SWISH_BINARY_PATH} = "/usr/lobal/bin/swish-e"; # # both can be set in the user's startup file # on daedalus (the production server) we cannot modify the config file # so we do it here BEGIN { require Sys::Hostname; my $hostname = Sys::Hostname::hostname(); if ($hostname && $hostname eq 'daedalus.apache.org') { $ENV{MODPERL_SITE} = "http://perl.apache.org/"; $ENV{SWISH_BINARY_PATH} = "/home/perlwww/bin/swish-e"; # unshift @INC, # qw( # /home/stas/lib/perl5/5.00503 # /home/stas/lib/perl5/site_perl/5.005 # /home/stas/lib/perl5/site_perl/ # /home/stas/lib/perl5/site_perl/ # /home/stas/lib/perl5/ # ); } } use FindBin qw($Bin); use Cwd (); my $verbose_level = exists $opts{v} ? 1 : 0; my $verbose_level_reverse = exists $opts{v} ? 0 : 1; my $swish_binary = $ENV{SWISH_BINARY_PATH} || './swish-e'; die "Cannot find swish-e at $swish_binary: $!" unless -x $swish_binary; my $cwd = Cwd::fastcwd(); chdir "$Bin/../dst_html/search"; $ENV{SPIDER_QUIET} = $verbose_level_reverse; # index my $command = "$swish_binary -v $verbose_level -S prog -c swish.conf"; #print "$command\n"; CORE::system($command); chdir $cwd;