77 |
By default turned on if C<--marc-normalize> is used. You can disable lint |
By default turned on if C<--marc-normalize> is used. You can disable lint |
78 |
messages with C<--no-marc-lint>. |
messages with C<--no-marc-lint>. |
79 |
|
|
80 |
|
=item --marc-dump |
81 |
|
|
82 |
|
Force dump or input and marc record for debugging. |
83 |
|
|
84 |
=back |
=back |
85 |
|
|
86 |
=cut |
=cut |
96 |
my $validate_path; |
my $validate_path; |
97 |
my ($marc_normalize, $marc_output); |
my ($marc_normalize, $marc_output); |
98 |
my $marc_lint = 1; |
my $marc_lint = 1; |
99 |
|
my $marc_dump = 0; |
100 |
|
|
101 |
GetOptions( |
GetOptions( |
102 |
"limit=i" => \$limit, |
"limit=i" => \$limit, |
111 |
"marc-normalize=s" => \$marc_normalize, |
"marc-normalize=s" => \$marc_normalize, |
112 |
"marc-output=s" => \$marc_output, |
"marc-output=s" => \$marc_output, |
113 |
"marc-lint!" => \$marc_lint, |
"marc-lint!" => \$marc_lint, |
114 |
|
"marc-dump!" => \$marc_dump, |
115 |
); |
); |
116 |
|
|
117 |
$config = LoadFile($config); |
$config = LoadFile($config); |
328 |
$log->warn("MARC record $mfn is empty, skipping"); |
$log->warn("MARC record $mfn is empty, skipping"); |
329 |
} else { |
} else { |
330 |
$marc->add_fields( @marc_fields ); |
$marc->add_fields( @marc_fields ); |
331 |
|
|
332 |
if ($marc_lint) { |
if ($marc_lint) { |
333 |
$lint->check_record( $marc ); |
$lint->check_record( $marc ); |
334 |
my $err = join( "\n", $lint->warnings ); |
my $err = join( "\n", $lint->warnings ); |
338 |
"MARC lint warnings: ",$err,"\n" |
"MARC lint warnings: ",$err,"\n" |
339 |
) if ($err); |
) if ($err); |
340 |
} |
} |
341 |
|
|
342 |
|
if ($marc_dump) { |
343 |
|
$log->info("MARC record on MFN $mfn\n", |
344 |
|
"Original imput row: ",dump($row), "\n", |
345 |
|
"Normalized MARC row: ",dump(@marc_fields), "\n", |
346 |
|
); |
347 |
|
} |
348 |
|
|
349 |
print $marc_fh $marc->as_usmarc; |
print $marc_fh $marc->as_usmarc; |
350 |
} |
} |
351 |
} |
} |