/[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 684 by dpavlin, Sun Sep 24 15:53:54 2006 UTC revision 702 by dpavlin, Mon Sep 25 13:08:17 2006 UTC
# Line 7  use File::Temp qw/tempdir/; Line 7  use File::Temp qw/tempdir/;
7  use lib './lib';  use lib './lib';
8    
9  use WebPAC::Common 0.02;  use WebPAC::Common 0.02;
10    use WebPAC::Parser 0.04;
11  use WebPAC::Lookup 0.03;  use WebPAC::Lookup 0.03;
12  use WebPAC::Input 0.11;  use WebPAC::Input 0.11;
13  use WebPAC::Store 0.03;  use WebPAC::Store 0.03;
# Line 174  if ($stats) { Line 175  if ($stats) {
175  # disable indexing when creating marc  # disable indexing when creating marc
176  $use_indexer = undef if ($marc_normalize);  $use_indexer = undef if ($marc_normalize);
177    
178    # parse normalize files and create source files for lookup and normalization
179    
180    my $parser = new WebPAC::Parser( config => $config );
181    
182  my $total_rows = 0;  my $total_rows = 0;
183  my $start_t = time();  my $start_t = time();
184    
# Line 309  while (my ($database, $db_config) = each Line 314  while (my ($database, $db_config) = each
314    
315                  die "I know only how to handle input types ", join(",", $config->webpac('inputs') ), " not '$type'!\n" unless (grep(/$type/, $config->webpac('inputs')));                  die "I know only how to handle input types ", join(",", $config->webpac('inputs') ), " not '$type'!\n" unless (grep(/$type/, $config->webpac('inputs')));
316    
                 my $lookup;  
                 if ($input->{lookup}) {  
                         $lookup = new WebPAC::Lookup(  
                                 lookup_file => $input->{lookup},  
                         );  
                         delete( $input->{lookup} );  
                 }  
   
317                  my $input_module = $config->webpac('inputs')->{$type};                  my $input_module = $config->webpac('inputs')->{$type};
318    
319                  $log->info("working on input '$input->{name}' in $input->{path} [type: $input->{type}] using $input_module",                  $log->info("working on input '$input->{name}' in $input->{path} [type: $input->{type}] using $input_module",
# Line 329  while (my ($database, $db_config) = each Line 326  while (my ($database, $db_config) = each
326                          delete($input->{modify_file});                          delete($input->{modify_file});
327                  }                  }
328    
329                    warn "parser->depends = ", dump( $parser->{depends} );
330                    warn "depends on: ", dump( $parser->depends($database, $input->{name}) );
331                    warn "lookup_create_rules = ", dump( $parser->lookup_create_rules($database, $input->{name}) );
332                    warn "parser->_lookup_create = ", dump( $parser->{_lookup_create} );
333    
334                    my $lookup;
335    
336                  my $input_db = new WebPAC::Input(                  my $input_db = new WebPAC::Input(
337                          module => $input_module,                          module => $input_module,
338                          encoding => $config->webpac('webpac_encoding'),                          encoding => $config->webpac('webpac_encoding'),
# Line 345  while (my ($database, $db_config) = each Line 349  while (my ($database, $db_config) = each
349                  );                  );
350                  $log->logdie("can't create input using $input_module") unless ($input);                  $log->logdie("can't create input using $input_module") unless ($input);
351    
352                    if (defined( $input->{lookup} )) {
353                            $log->warn("$database/", $input->{name}, " has depriciated lookup definition, removing it...");
354                            delete( $input->{lookup} );
355                    }
356    
357                  my $maxmfn = $input_db->open(                  my $maxmfn = $input_db->open(
358                          path => $input->{path},                          path => $input->{path},
359                          code_page => $input->{encoding},        # database encoding                          code_page => $input->{encoding},        # database encoding

Legend:
Removed from v.684  
changed lines
  Added in v.702

  ViewVC Help
Powered by ViewVC 1.1.26