/[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 1183 by dpavlin, Mon May 18 18:47:22 2009 UTC revision 1198 by dpavlin, Thu May 28 10:15:20 2009 UTC
# Line 22  use File::Slurp; Line 22  use File::Slurp;
22  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
23  use Storable qw/dclone/;  use Storable qw/dclone/;
24  use Pod::Usage qw/pod2usage/;  use Pod::Usage qw/pod2usage/;
25  use LWP::Simple;  use LWP::Simple qw//;
26    
27  use POSIX ":sys_wait_h"; # imports WNOHANG  use POSIX ":sys_wait_h"; # imports WNOHANG
28    
# Line 417  foreach my $database ( sort keys %{ $con Line 417  foreach my $database ( sort keys %{ $con
417                          $base =~ s{/[^/]+$}{};                          $base =~ s{/[^/]+$}{};
418                          mkpath $base unless -e $base;                          mkpath $base unless -e $base;
419    
420                          my $rc = mirror( "$mirror/$path", $path );                          my $rc = LWP::Simple::mirror( "$mirror/$path", $path );
421                          if (is_error( $rc )) {                          if (LWP::Simple::is_error( $rc )) {
422                                  die "can't mirror $mirror/$path -> $path [$rc]";                                  die "can't mirror $mirror/$path -> $path [$rc]";
423                          } else {                          } else {
424                                  $log->info( "mirror ", $path, " [$rc] ", -s $path, " bytes" );                                  $log->info( "mirror ", $path, " [$rc] ", -s $path, " bytes" );
# Line 513  foreach my $database ( sort keys %{ $con Line 513  foreach my $database ( sort keys %{ $con
513    
514                  my $report_fh;                  my $report_fh;
515                  if ($stats || $validate) {                  if ($stats || $validate) {
516                          my $path = "out/report/${database}-${input_name}.txt";                          my $out_report = 'out/report'; # FIXME move to config
517                            mkpath $out_report unless -e $out_report;
518                            my $path = "$out_report/${database}-${input_name}.txt";
519                          open($report_fh, '>', $path) || $log->logdie("can't open $path: $!");                          open($report_fh, '>', $path) || $log->logdie("can't open $path: $!");
520    
521                          print $report_fh "Report for database '$database' input '$input_name' records ",                          print $report_fh "Report for database '$database' input '$input_name' records ",
# Line 528  foreach my $database ( sort keys %{ $con Line 530  foreach my $database ( sort keys %{ $con
530    
531                  my $marc;                  my $marc;
532                  if ($marc_generate && $parser->have_rules( 'marc', $database, $input_name )) {                  if ($marc_generate && $parser->have_rules( 'marc', $database, $input_name )) {
533                            
534                            my $out_marc = 'out/marc'; # FIXME move to config
535                            mkpath $out_marc unless -e $out_marc;
536    
537                          $marc = new WebPAC::Output::MARC(                          $marc = new WebPAC::Output::MARC(
538                                  path => "out/marc/${database}-${input_name}.marc",                                  path => "$out_marc/${database}-${input_name}.marc",
539                                  lint => $marc_lint,                                  lint => $marc_lint,
540                                  dump => $marc_dump,                                  dump => $marc_dump,
541                          );                          );
# Line 597  foreach my $database ( sort keys %{ $con Line 603  foreach my $database ( sort keys %{ $con
603                                  push @{ $row->{'000'} }, $pos;                                  push @{ $row->{'000'} }, $pos;
604                          }                          }
605    
606                            foreach my $out ( @output_modules ) {
607                                    $out->add_row( $mfn, $row ) if $out->can('add_row');
608                            }
609    
610                          if ($validate) {                          if ($validate) {
611                                  if ( my $errors = $validate->validate_rec( $row, $input_db->dump_ascii ) ) {                                  if ( my $errors = $validate->validate_rec( $row, $input_db->dump_ascii ) ) {

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

  ViewVC Help
Powered by ViewVC 1.1.26