/[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 790 by dpavlin, Wed Dec 13 10:08:27 2006 UTC revision 833 by dpavlin, Wed May 23 20:04:13 2007 UTC
# Line 12  use WebPAC::Input 0.16; Line 12  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;
15  use WebPAC::Validate 0.06;  use WebPAC::Validate 0.11;
16  use WebPAC::Output::MARC;  use WebPAC::Output::MARC;
17  use WebPAC::Config;  use WebPAC::Config;
18  use Getopt::Long;  use Getopt::Long;
# Line 68  and subfield usage for each input Line 68  and subfield usage for each input
68    
69  turn on extra validation of imput records, see L<WebPAC::Validation>  turn on extra validation of imput records, see L<WebPAC::Validation>
70    
71    =item --marc-generate
72    
73    Generate MARC file. This will automatically be on if file contains C<marc*> directives.
74    You can use this option as C<--no-marc-generate> to disable MARC generation.
75    
76  =item --marc-lint  =item --marc-lint
77    
78  By default turned on if normalisation file has C<marc*> directives. You can disable lint  By default turned on if normalisation file has C<marc*> directives. You can disable lint
# Line 103  my $debug = 0; Line 108  my $debug = 0;
108  my $only_filter;  my $only_filter;
109  my $stats = 0;  my $stats = 0;
110  my $validate_path;  my $validate_path;
111    my $marc_generate = 1;
112  my $marc_lint = 1;  my $marc_lint = 1;
113  my $marc_dump = 0;  my $marc_dump = 0;
114  my $parallel = 0;  my $parallel = 0;
# Line 122  GetOptions( Line 128  GetOptions(
128          "debug+" => \$debug,          "debug+" => \$debug,
129          "stats" => \$stats,          "stats" => \$stats,
130          "validate=s" => \$validate_path,          "validate=s" => \$validate_path,
131            "marc-generate!" => \$marc_generate,
132          "marc-lint!" => \$marc_lint,          "marc-lint!" => \$marc_lint,
133          "marc-dump!" => \$marc_dump,          "marc-dump!" => \$marc_dump,
134          "parallel=i" => \$parallel,          "parallel=i" => \$parallel,
# Line 160  if ($merge) { Line 167  if ($merge) {
167  my $validate;  my $validate;
168  $validate = new WebPAC::Validate(  $validate = new WebPAC::Validate(
169          path => $validate_path,          path => $validate_path,
170            delimiters => $config->webpac('delimiters'),
171  ) if ($validate_path);  ) if ($validate_path);
172    
173    
# Line 431  while (my ($database, $db_config) = each Line 439  while (my ($database, $db_config) = each
439                  }                  }
440    
441                  my $marc;                  my $marc;
442                  if ($parser->have_rules( 'marc', $database, $input_name )) {                  if ($marc_generate && $parser->have_rules( 'marc', $database, $input_name )) {
443                          $marc = new WebPAC::Output::MARC(                          $marc = new WebPAC::Output::MARC(
444                                  path => "out/marc/${database}-${input_name}.marc",                                  path => "out/marc/${database}-${input_name}.marc",
445                                  lint => $marc_lint,                                  lint => $marc_lint,
# Line 537  while (my ($database, $db_config) = each Line 545  while (my ($database, $db_config) = each
545                                          $marc->add(                                          $marc->add(
546                                                  id => $mfn . ( $i ? "/$i" : '' ),                                                  id => $mfn . ( $i ? "/$i" : '' ),
547                                                  fields => $fields,                                                  fields => $fields,
548                                                  leader => WebPAC::Normalize::marc_leader(),                                                  leader => WebPAC::Normalize::_get_marc_leader(),
549                                                  row => $row,                                                  row => $row,
550                                          );                                          );
551                                          $i++;                                          $i++;
# Line 553  while (my ($database, $db_config) = each Line 561  while (my ($database, $db_config) = each
561                                  $log->info("validation errors:\n$errors\n" );                                  $log->info("validation errors:\n$errors\n" );
562                                  print $report_fh "$errors\n" if ($report_fh);                                  print $report_fh "$errors\n" if ($report_fh);
563                          }                          }
564    
565                            print $report_fh "\nAll possible subfields/delimiter templates:\n", $validate->delimiters_templates, "\n\n";
566                  }                  }
567    
568                  if ($stats) {                  if ($stats) {

Legend:
Removed from v.790  
changed lines
  Added in v.833

  ViewVC Help
Powered by ViewVC 1.1.26