/[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 1198 by dpavlin, Thu May 28 10:15:20 2009 UTC revision 1223 by dpavlin, Tue Jun 9 21:41:49 2009 UTC
# Line 542  foreach my $database ( sort keys %{ $con Line 542  foreach my $database ( sort keys %{ $con
542                  }                  }
543    
544                  my $rules = $parser->normalize_rules($database,$input_name);                  my $rules = $parser->normalize_rules($database,$input_name);
545                  $log->logwarn("no normalize rules for $database/$input_name") unless $rules;                  $log->logwarn("no normalize rules for $database/$input_name", $input_db->input_module->can('normalize') ? " using normalize from input module" : '') unless $rules;
546    
547                  $log->debug("parsed normalize rules:\n$rules");                  $log->debug("parsed normalize rules:\n$rules");
548    
# Line 616  foreach my $database ( sort keys %{ $con Line 616  foreach my $database ( sort keys %{ $con
616                                  next;   # validation doesn't create any output                                  next;   # validation doesn't create any output
617                          }                          }
618    
619                            my $ds;
620    
621                          if ($rules) {                          if ($rules) {
622    
623                                  my $ds = WebPAC::Normalize::data_structure(                                  my $ds = WebPAC::Normalize::data_structure(
# Line 635  foreach my $database ( sort keys %{ $con Line 637  foreach my $database ( sort keys %{ $con
637                                          },                                          },
638                                  );                                  );
639    
640                                  $log->debug("ds = ", sub { dump($ds) });                          } elsif ( $input_db->input_module->can('normalize') ) {
641                                    $ds = $input_db->input_module->normalize( $mfn );
642                            }
643    
644                                  if ( $ds ) {                          if ( $ds ) {
645                                    $log->debug("ds = ", sub { dump($ds) });
646    
647                                          $store->save_ds(                                  $store->save_ds(
648                                                  database => $database,                                          database => $database,
649                                                  input => $input_name,                                          input => $input_name,
650                                                  id => $mfn,                                          id => $mfn,
651                                                  ds => $ds,                                          ds => $ds,
652                                          ) if !$stats;                                  ) if !$stats;
653    
654                                          $indexer->add(                                  $indexer->add(
655                                                  id => "${input_name}/${mfn}",                                          id => "${input_name}/${mfn}",
656                                                  ds => $ds,                                          ds => $ds,
657                                                  type => $config->get($indexer_config)->{type},                                          type => $config->get($indexer_config)->{type},
658                                          ) if $indexer;                                  ) if $indexer;
659    
660                                          foreach my $out ( @output_modules ) {                                  foreach my $out ( @output_modules ) {
661                                                  $out->add( $mfn, $ds ) if $out->can('add');                                          $out->add( $mfn, $ds ) if $out->can('add');
                                         }  
   
                                 } else {  
                                         $log->warn("record $pos didn't produce any output after normalization rules!") unless $marc;  
662                                  }                                  }
                         }  
663    
664                            } else {
665                                    $log->warn("record $pos didn't produce any output after normalization rules!") unless $marc;
666                            }
667                          if ($marc) {                          if ($marc) {
668                                  my $i = 0;                                  my $i = 0;
669    

Legend:
Removed from v.1198  
changed lines
  Added in v.1223

  ViewVC Help
Powered by ViewVC 1.1.26