/[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 539 by dpavlin, Thu Jun 29 15:29:32 2006 UTC revision 540 by dpavlin, Thu Jun 29 15:29:41 2006 UTC
# Line 19  use Getopt::Long; Line 19  use Getopt::Long;
19  use File::Path;  use File::Path;
20  use Time::HiRes qw/time/;  use Time::HiRes qw/time/;
21  use File::Slurp;  use File::Slurp;
22    use MARC::Record;
23    
24  =head1 NAME  =head1 NAME
25    
# Line 234  while (my ($database, $db_config) = each Line 235  while (my ($database, $db_config) = each
235    
236                          $log->info("Using $normalize_path for normalization...");                          $log->info("Using $normalize_path for normalization...");
237    
238                            my $marc_fh;
239                            if (my $path = $normalize->{marc21}) {
240                                    open($marc_fh, '>', $path) ||
241                                            $log->logdie("can't open MARC output $path: $!");
242    
243                                    $log->info("Creating MARC export file $path\n");
244                            }
245    
246                          # reset position in database                          # reset position in database
247                          $input_db->seek(1);                          $input_db->seek(1);
248    
# Line 272  while (my ($database, $db_config) = each Line 281  while (my ($database, $db_config) = each
281                                          id => $input->{name} . "/" . $mfn,                                          id => $input->{name} . "/" . $mfn,
282                                          ds => $ds,                                          ds => $ds,
283                                          type => $config->{$use_indexer}->{type},                                          type => $config->{$use_indexer}->{type},
284                                  ) if ($indexer);                                  ) if ($indexer && $ds);
285    
286                                    if ($marc_fh) {
287                                            my $marc = new MARC::Record;
288                                            $marc->add_fields( WebPAC::Normalize::_get_marc21_fields() );
289                                            print $marc_fh $marc->as_usmarc;
290                                    }
291    
292                                  $total_rows++;                                  $total_rows++;
293                          }                          }
294    
295                          $log->info("statistics of fields usage:\n", $input_db->stats) if ($stats);                          $log->info("statistics of fields usage:\n", $input_db->stats) if ($stats);
296    
297                  };                          # close MARC file
298                            close($marc_fh) if ($marc_fh);
299    
300                    }
301    
302          }          }
303    

Legend:
Removed from v.539  
changed lines
  Added in v.540

  ViewVC Help
Powered by ViewVC 1.1.26