21 |
use File::Slurp; |
use File::Slurp; |
22 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
23 |
use Storable qw/dclone/; |
use Storable qw/dclone/; |
24 |
|
use Pod::Usage qw/pod2usage/; |
25 |
|
|
26 |
use Proc::Queue size => 1; |
use Proc::Queue size => 1; |
27 |
use POSIX ":sys_wait_h"; # imports WNOHANG |
use POSIX ":sys_wait_h"; # imports WNOHANG |
32 |
|
|
33 |
B<this command will probably go away. Don't get used to it!> |
B<this command will probably go away. Don't get used to it!> |
34 |
|
|
35 |
Options: |
=head1 OPTIONS |
36 |
|
|
37 |
=over 4 |
=over 4 |
38 |
|
|
68 |
|
|
69 |
turn on extra validation of imput records, see L<WebPAC::Validation> |
turn on extra validation of imput records, see L<WebPAC::Validation> |
70 |
|
|
71 |
|
=item --marc-generate |
72 |
|
|
73 |
|
Generate MARC file. This will automatically be on if file contains C<marc*> directives. |
74 |
|
You can use this option as C<--no-marc-generate> to disable MARC generation. |
75 |
|
|
76 |
=item --marc-lint |
=item --marc-lint |
77 |
|
|
78 |
By default turned on if normalisation file has C<marc*> directives. You can disable lint |
By default turned on if normalisation file has C<marc*> directives. You can disable lint |
108 |
my $only_filter; |
my $only_filter; |
109 |
my $stats = 0; |
my $stats = 0; |
110 |
my $validate_path; |
my $validate_path; |
111 |
|
my $marc_generate = 1; |
112 |
my $marc_lint = 1; |
my $marc_lint = 1; |
113 |
my $marc_dump = 0; |
my $marc_dump = 0; |
114 |
my $parallel = 0; |
my $parallel = 0; |
115 |
my $only_links = 0; |
my $only_links = 0; |
116 |
my $merge = 0; |
my $merge = 0; |
117 |
|
my $help; |
118 |
|
|
119 |
my $log = _new WebPAC::Common()->_get_logger(); |
my $log = _new WebPAC::Common()->_get_logger(); |
120 |
|
|
128 |
"debug+" => \$debug, |
"debug+" => \$debug, |
129 |
"stats" => \$stats, |
"stats" => \$stats, |
130 |
"validate=s" => \$validate_path, |
"validate=s" => \$validate_path, |
131 |
|
"marc-generate!" => \$marc_generate, |
132 |
"marc-lint!" => \$marc_lint, |
"marc-lint!" => \$marc_lint, |
133 |
"marc-dump!" => \$marc_dump, |
"marc-dump!" => \$marc_dump, |
134 |
"parallel=i" => \$parallel, |
"parallel=i" => \$parallel, |
135 |
"only-links!" => \$only_links, |
"only-links!" => \$only_links, |
136 |
"merge" => \$merge, |
"merge" => \$merge, |
137 |
|
"help" => \$help, |
138 |
); |
); |
139 |
|
|
140 |
|
pod2usage(-verbose => 2) if ($help); |
141 |
|
|
142 |
my $config = new WebPAC::Config( path => $config_path ); |
my $config = new WebPAC::Config( path => $config_path ); |
143 |
|
|
144 |
#print "config = ",dump($config) if ($debug); |
#print "config = ",dump($config) if ($debug); |
438 |
} |
} |
439 |
|
|
440 |
my $marc; |
my $marc; |
441 |
if ($parser->have_rules( 'marc', $database, $input_name )) { |
if ($marc_generate && $parser->have_rules( 'marc', $database, $input_name )) { |
442 |
$marc = new WebPAC::Output::MARC( |
$marc = new WebPAC::Output::MARC( |
443 |
path => "out/marc/${database}-${input_name}.marc", |
path => "out/marc/${database}-${input_name}.marc", |
444 |
lint => $marc_lint, |
lint => $marc_lint, |