81 |
|
|
82 |
$log->info("opening DBF database '$arg->{path}' with $size records"); |
$log->info("opening DBF database '$arg->{path}' with $size records"); |
83 |
|
|
84 |
my $mapping_path = $arg->{input_config}->{mapping_path}; |
my $mapping_path = $arg->{input_config}->{mapping_path} || $self->{input_config}->{mapping_path}; |
85 |
my $mapping; |
my $mapping; |
86 |
|
|
87 |
if ( ! $mapping_path ) { |
if ( ! $mapping_path || ! -e $mapping_path ) { |
88 |
$log->debug("didn't found any mapping_path in configuration", sub { dump( $arg->{input_config} ) }); |
$log->debug("didn't found any mapping_path in configuration", sub { dump( $arg->{input_config} ) }); |
89 |
|
|
90 |
foreach my $field ( $db->field_names ) { |
foreach my $field ( $db->field_names ) { |
96 |
|
|
97 |
$log->logdie("mapping file $mapping_path allready exists, aborting.") if ( -e $mapping_path ); |
$log->logdie("mapping file $mapping_path allready exists, aborting.") if ( -e $mapping_path ); |
98 |
|
|
99 |
DumpFile( $mapping_path, Dump( { mapping => $mapping } ) ) || |
DumpFile( $mapping_path, { mapping => $mapping } ) || |
100 |
$log->logdie("can't write template file for mapping_path $mapping_path: $!"); |
$log->logdie("can't write template file for mapping_path $mapping_path: $!"); |
101 |
|
|
102 |
$log->logdie("template file for mapping_path created as $mapping_path"); |
$log->logdie("template file for mapping_path created as $mapping_path"); |