/[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 762 by dpavlin, Wed Oct 25 18:54:45 2006 UTC revision 774 by dpavlin, Fri Nov 3 20:56:21 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 153  $validate = new WebPAC::Validate( Line 153  $validate = new WebPAC::Validate(
153    
154    
155  my $use_indexer = $config->use_indexer;  my $use_indexer = $config->use_indexer;
156    $stats ||= $validate;
157  if ($stats) {  if ($stats) {
158          $log->debug("option --stats disables update of indexing engine...");          $log->debug("disabled indexing for stats collection");
159          $use_indexer = undef;          $use_indexer = undef;
160  } else {  } else {
161          $log->info("using $use_indexer indexing engine...");          $log->info("using $use_indexer indexing engine...");
# Line 396  while (my ($database, $db_config) = each Line 397  while (my ($database, $db_config) = each
397                  my $lookup_data = WebPAC::Normalize::_get_lookup();                  my $lookup_data = WebPAC::Normalize::_get_lookup();
398    
399                  if (defined( $lookup_data->{$database}->{$input_name} )) {                  if (defined( $lookup_data->{$database}->{$input_name} )) {
400                          $log->debug("created following lookups: ", dump( $lookup_data ));                          $log->debug("created following lookups: ", sub { dump( $lookup_data ) } );
401    
402                          foreach my $key (keys %{ $lookup_data->{$database}->{$input_name} }) {                          foreach my $key (keys %{ $lookup_data->{$database}->{$input_name} }) {
403                                  $store->save_lookup(                                  $store->save_lookup(
# Line 467  while (my ($database, $db_config) = each Line 468  while (my ($database, $db_config) = each
468    
469                          my $row = $input_db->fetch || next;                          my $row = $input_db->fetch || next;
470    
471                            $total_rows++;
472    
473                          my $mfn = $row->{'000'}->[0];                          my $mfn = $row->{'000'}->[0];
474    
475                          if (! $mfn || $mfn !~ m#^\d+$#) {                          if (! $mfn || $mfn !~ m#^\d+$#) {
# Line 477  while (my ($database, $db_config) = each Line 480  while (my ($database, $db_config) = each
480    
481    
482                          if ($validate) {                          if ($validate) {
483                                  if ( my $errors = $validate->validate_errors( $row, $input_db->dump ) ) {                                  if ( my $errors = $validate->validate_rec( $row, $input_db->dump_ascii ) ) {
484                                          $log->error( "MFN $mfn validation error:\n",                                          $log->error( "MFN $mfn validation error:\n",
485                                                  $validate->report_error( $errors )                                                  $validate->report_error( $errors )
486                                          );                                          );
487                                  }                                  }
488                                    next;   # validation doesn't create any output
489                          }                          }
490    
491                          my $ds = WebPAC::Normalize::data_structure(                          my $ds = WebPAC::Normalize::data_structure(
# Line 500  while (my ($database, $db_config) = each Line 504  while (my ($database, $db_config) = each
504                                  },                                  },
505                          );                          );
506    
507                          $log->debug("ds = ",dump($ds)) if ($ds);                          $log->debug("ds = ", sub { dump($ds) }) if ($ds);
508    
509                          $store->save_ds(                          $store->save_ds(
510                                  database => $database,                                  database => $database,
# Line 530  while (my ($database, $db_config) = each Line 534  while (my ($database, $db_config) = each
534    
535                                  $log->info("Created $i instances of MFN $mfn\n") if ($i > 1);                                  $log->info("Created $i instances of MFN $mfn\n") if ($i > 1);
536                          }                          }
   
                         $total_rows++;  
537                  }                  }
538    
539                  if ($validate) {                  if ($validate) {

Legend:
Removed from v.762  
changed lines
  Added in v.774

  ViewVC Help
Powered by ViewVC 1.1.26