/[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 547 by dpavlin, Thu Jun 29 23:19:26 2006 UTC revision 552 by dpavlin, Fri Jun 30 20:43:18 2006 UTC
# Line 63  usage for each input Line 63  usage for each input
63    
64  turn on extra validation of imput records, see L<WebPAC::Validation>  turn on extra validation of imput records, see L<WebPAC::Validation>
65    
66    =item --marc-normalize conf/normalize/mapping.pl
67    
68    This option specifies normalisation file for MARC creation
69    
70    =item --marc-output out/marc/test.marc
71    
72    Optional path to output file
73    
74  =back  =back
75    
76  =cut  =cut
# Line 76  my $debug = 0; Line 84  my $debug = 0;
84  my $only_filter;  my $only_filter;
85  my $stats = 0;  my $stats = 0;
86  my $validate_path;  my $validate_path;
87    my ($marc_normalize, $marc_output);
88    
89  GetOptions(  GetOptions(
90          "limit=i" => \$limit,          "limit=i" => \$limit,
# Line 87  GetOptions( Line 96  GetOptions(
96          "debug" => \$debug,          "debug" => \$debug,
97          "stats" => \$stats,          "stats" => \$stats,
98          "validate=s" => \$validate_path,          "validate=s" => \$validate_path,
99            "marc-normalize=s" => \$marc_normalize,
100            "marc-output=s" => \$marc_output,
101  );  );
102    
103  $config = LoadFile($config);  $config = LoadFile($config);
# Line 111  if ($stats) { Line 122  if ($stats) {
122          $log->info("using $use_indexer indexing engine...");          $log->info("using $use_indexer indexing engine...");
123  }  }
124    
125    # disable indexing when creating marc
126    $use_indexer = undef if ($marc_normalize);
127    
128  my $total_rows = 0;  my $total_rows = 0;
129  my $start_t = time();  my $start_t = time();
130    
# Line 224  while (my ($database, $db_config) = each Line 238  while (my ($database, $db_config) = each
238                  my @norm_array = ref($input->{normalize}) eq 'ARRAY' ?                  my @norm_array = ref($input->{normalize}) eq 'ARRAY' ?
239                          @{ $input->{normalize} } : ( $input->{normalize} );                          @{ $input->{normalize} } : ( $input->{normalize} );
240    
241                    if ($marc_normalize) {
242                            @norm_array = ( {
243                                    path => $marc_normalize,
244                                    output => $marc_output || 'out/marc/' . $database . '-' . $input->{name} . '.marc',
245                            } );
246                    }
247    
248                  foreach my $normalize (@norm_array) {                  foreach my $normalize (@norm_array) {
249    
250                          my $normalize_path = $normalize->{path} || $log->logdie("can't find normalize path in config");                          my $normalize_path = $normalize->{path} || $log->logdie("can't find normalize path in config");
# Line 235  while (my ($database, $db_config) = each Line 256  while (my ($database, $db_config) = each
256                          $log->info("Using $normalize_path for normalization...");                          $log->info("Using $normalize_path for normalization...");
257    
258                          my $marc_fh;                          my $marc_fh;
259                          if (my $path = $normalize->{marc21}) {                          if (my $path = $normalize->{output}) {
260                                  open($marc_fh, '>', $path) ||                                  open($marc_fh, '>', $path) ||
261                                          $log->logdie("can't open MARC output $path: $!");                                          $log->logdie("can't open MARC output $path: $!");
262    
# Line 314  while (my ($database, $db_config) = each Line 335  while (my ($database, $db_config) = each
335          #          #
336          # add Hyper Estraier links to other databases          # add Hyper Estraier links to other databases
337          #          #
338          if (ref($db_config->{links}) eq 'ARRAY') {          if (ref($db_config->{links}) eq 'ARRAY' && $use_indexer) {
339                  foreach my $link (@{ $db_config->{links} }) {                  foreach my $link (@{ $db_config->{links} }) {
340                          if ($use_indexer eq 'hyperestraier') {                          if ($use_indexer eq 'hyperestraier') {
341                                  $log->info("saving link $database -> $link->{to} [$link->{credit}]");                                  $log->info("saving link $database -> $link->{to} [$link->{credit}]");

Legend:
Removed from v.547  
changed lines
  Added in v.552

  ViewVC Help
Powered by ViewVC 1.1.26