/[wait]/cvs-head/script/index_ora
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /cvs-head/script/index_ora

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 66 by laperla, Wed Jan 23 12:22:54 2002 UTC revision 67 by laperla, Thu Jan 24 00:40:43 2002 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl -w  #!/usr/bin/perl -w
2  #                              -*- Mode: Perl -*-  #                              -*- Mode: Perl -*-
3  # $Basename$  # $Basename$
4  # $Revision: 1.4 $  # $Revision: 1.5 $
5  # Author          : Ulrich Pfeifer  # Author          : Ulrich Pfeifer
6  # Created On      : Mon Dec 31 13:57:11 2001  # Created On      : Mon Dec 31 13:57:11 2001
7  # Last Modified By: Ulrich Pfeifer  # Last Modified By: Ulrich Pfeifer
# Line 26  require WAIT::InvertedIndex; Line 26  require WAIT::InvertedIndex;
26    
27  $DB_BTREE->{'cachesize'} = 200_000 ;  $DB_BTREE->{'cachesize'} = 200_000 ;
28    
29  my %OPT = (clean    => 0,  my %OPT = (
30             database => 'DB',             database => 'DB',
31             dir      => $WAIT::Config->{WAIT_home} || '/tmp',             dir      => $WAIT::Config->{WAIT_home} || '/tmp',
32             table    => 'ora',             table    => 'ora',
33            );            );
34    
35  GetOptions(\%OPT,  GetOptions(\%OPT,
            'clean!',  
36             'database=s',             'database=s',
37             'dir=s',             'dir=s',
38             'table=s',             'table=s',
39            ) || die "Usage: ...\n";            ) || die "Usage: ...\n";
40    
 if ($OPT{clean} and -d "$OPT{dir}/$OPT{database}") {  
   my $tmp = WAIT::Database->open(name        => $OPT{database},  
                                  'directory' => $OPT{dir})  
     or die "Could not open table $OPT{table}: $@\n";  
   my $tbl = $tmp->table(name => $OPT{table});  
   $tbl->drop if $tbl;  
   rmtree("$OPT{dir}/$OPT{database}/$OPT{table}", 1, 1)  
     if -d "$OPT{dir}/$OPT{database}/$OPT{table}";  
   $tmp->close;  
 }  
   
41  my $db;  my $db;
42  unless (-d "$OPT{dir}/$OPT{database}") {  unless (-d "$OPT{dir}/$OPT{database}") {
43    $db = WAIT::Database->create(name       => $OPT{database},    $db = WAIT::Database->create(name       => $OPT{database},
# Line 125  index_ora - generate an WAIT index for O Line 113  index_ora - generate an WAIT index for O
113  =head1 SYNOPSIS  =head1 SYNOPSIS
114    
115  B<index_ora>  B<index_ora>
 [B<-clean>] [B<-noclean>]  
116  [B<-database> I<dbname>]  [B<-database> I<dbname>]
117  [B<-dir> I<directory>]  [B<-dir> I<directory>]
118  [B<-table> I<table name>]  [B<-table> I<table name>]
# Line 137  I<directory> Line 124  I<directory>
124    
125  =over 5  =over 5
126    
 =item B<-clean> / B<-noclean>  
   
 Clean the table before indexing. Default is B<off>.  
   
127  =item B<-database> I<dbname>  =item B<-database> I<dbname>
128    
129  Specify database name. Default is F<DB>.  Specify database name. Default is F<DB>.

Legend:
Removed from v.66  
changed lines
  Added in v.67

  ViewVC Help
Powered by ViewVC 1.1.26