/[webpac2]/trunk/run.pl
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 /trunk/run.pl

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

revision 765 by dpavlin, Wed Oct 25 21:01:51 2006 UTC revision 775 by dpavlin, Sun Nov 5 12:28:37 2006 UTC
# Line 8  use lib './lib'; Line 8  use lib './lib';
8    
9  use WebPAC::Common 0.02;  use WebPAC::Common 0.02;
10  use WebPAC::Parser 0.08;  use WebPAC::Parser 0.08;
11  use WebPAC::Input 0.14;  use WebPAC::Input 0.16;
12  use WebPAC::Store 0.14;  use WebPAC::Store 0.14;
13  use WebPAC::Normalize 0.22;  use WebPAC::Normalize 0.22;
14  use WebPAC::Output::TT;  use WebPAC::Output::TT;
# Line 135  die "no databases in config file!\n" unl Line 135  die "no databases in config file!\n" unl
135    
136  $log->info( "-" x 79 );  $log->info( "-" x 79 );
137    
138    my $log_file = 'log';
139    
140    if (-e $log_file ) {    # && -s $log_file > 5 * 1024 * 1024) {
141            $log->info("moved old log with ", -s $log_file, " bytes to '${log_file}.old'");
142            rename $log_file, "${log_file}.old" || $log->logwarn("can't rename $log_file to ${log_file}.old: $!");
143    }
144    
145  my $estcmd_fh;  my $estcmd_fh;
146  my $estcmd_path = './estcmd-merge.sh';  my $estcmd_path = './estcmd-merge.sh';
# Line 153  $validate = new WebPAC::Validate( Line 159  $validate = new WebPAC::Validate(
159    
160    
161  my $use_indexer = $config->use_indexer;  my $use_indexer = $config->use_indexer;
162    $stats ||= $validate;
163  if ($stats) {  if ($stats) {
164          $log->debug("option --stats disables update of indexing engine...");          $log->debug("disabled indexing for stats collection");
165          $use_indexer = undef;          $use_indexer = undef;
166  } else {  } else {
167          $log->info("using $use_indexer indexing engine...");          $log->info("using $use_indexer indexing engine...");
# Line 467  while (my ($database, $db_config) = each Line 474  while (my ($database, $db_config) = each
474    
475                          my $row = $input_db->fetch || next;                          my $row = $input_db->fetch || next;
476    
477                            $total_rows++;
478    
479                          my $mfn = $row->{'000'}->[0];                          my $mfn = $row->{'000'}->[0];
480    
481                          if (! $mfn || $mfn !~ m#^\d+$#) {                          if (! $mfn || $mfn !~ m#^\d+$#) {
# Line 477  while (my ($database, $db_config) = each Line 486  while (my ($database, $db_config) = each
486    
487    
488                          if ($validate) {                          if ($validate) {
489                                  if ( my $errors = $validate->validate_errors( $row, $input_db->dump ) ) {                                  if ( my $errors = $validate->validate_rec( $row, $input_db->dump_ascii ) ) {
490                                          $log->error( "MFN $mfn validation error:\n",                                          $log->error( "MFN $mfn validation error:\n",
491                                                  $validate->report_error( $errors )                                                  $validate->report_error( $errors )
492                                          );                                          );
493                                  }                                  }
494                                    next;   # validation doesn't create any output
495                          }                          }
496    
497                          my $ds = WebPAC::Normalize::data_structure(                          my $ds = WebPAC::Normalize::data_structure(
# Line 530  while (my ($database, $db_config) = each Line 540  while (my ($database, $db_config) = each
540    
541                                  $log->info("Created $i instances of MFN $mfn\n") if ($i > 1);                                  $log->info("Created $i instances of MFN $mfn\n") if ($i > 1);
542                          }                          }
   
                         $total_rows++;  
543                  }                  }
544    
545                  if ($validate) {                  if ($validate) {

Legend:
Removed from v.765  
changed lines
  Added in v.775

  ViewVC Help
Powered by ViewVC 1.1.26