--- trunk/run.pl 2006/07/05 19:52:45 585 +++ trunk/run.pl 2006/07/13 21:31:32 600 @@ -7,7 +7,7 @@ use lib './lib'; use WebPAC::Common 0.02; -use WebPAC::Lookup; +use WebPAC::Lookup 0.03; use WebPAC::Input 0.07; use WebPAC::Store 0.03; use WebPAC::Normalize 0.11; @@ -20,6 +20,7 @@ use Time::HiRes qw/time/; use File::Slurp; use Data::Dump qw/dump/; +use Storable qw/dclone/; =head1 NAME @@ -221,9 +222,13 @@ die "I know only how to handle input types ", join(",", @supported_inputs), " not '$type'!\n" unless (grep(/$type/, @supported_inputs)); - my $lookup = new WebPAC::Lookup( - lookup_file => $input->{lookup}, - ) if ($input->{lookup}); + my $lookup; + if ($input->{lookup}) { + $lookup = new WebPAC::Lookup( + lookup_file => $input->{lookup}, + ); + delete( $input->{lookup} ); + } my $input_module = $config->{webpac}->{inputs}->{$type}; @@ -242,6 +247,7 @@ }, recode => $input->{recode}, stats => $stats, + modify_records => $input->{modify_records}, ); $log->logdie("can't create input using $input_module") unless ($input); @@ -298,10 +304,22 @@ $log->error( "MFN $mfn validation errors:\n", join("\n", @errors) ) if (@errors); } + my $ds_config = dclone($db_config); + + # default values -> database key + $ds_config->{_} = $database; + + # current mfn + $ds_config->{_mfn} = $mfn; + + # attach current input + $ds_config->{input} = $input; + my $ds = WebPAC::Normalize::data_structure( row => $row, rules => $rules, lookup => $lookup ? $lookup->lookup_hash : undef, + config => $ds_config, marc_encoding => 'utf-8', );