package PublicInbox::LeiInput;
use strict;
use v5.10.1;
+use PublicInbox::DS;
sub check_input_format ($;$) {
my ($lei, $files) = @_;
my $m = $lei->{opt}->{'lock'} //
PublicInbox::MboxLock->defaults;
my $mbl = PublicInbox::MboxLock->acq($input, 0, $m);
+ my $zsfx = PublicInbox::MboxReader::zsfx($input);
+ if ($zsfx) {
+ my $in = delete $mbl->{fh};
+ $mbl->{fh} =
+ PublicInbox::MboxReader::zsfxcat($in, $zsfx, $lei);
+ }
+ local $PublicInbox::DS::in_loop = 0 if $zsfx; # dwaitpid
$self->input_fh($ifmt, $mbl->{fh}, $input, @args);
} elsif (-d _ && (-d "$input/cur" || -d "$input/new")) {
return $lei->fail(<<EOM) if $ifmt && $ifmt ne 'maildir';
$input appears to a be a maildir, not $ifmt
EOM
- PublicInbox::MdirReader::maildir_each_eml($input,
+ PublicInbox::MdirReader->new->maildir_each_eml($input,
$self->can('input_maildir_cb'),
$self, @args);
} else {
$self->{inputs} = $inputs;
}
+sub process_inputs {
+ my ($self) = @_;
+ for my $input (@{$self->{inputs}}) {
+ $self->input_path_url($input);
+ }
+ my $wait = $self->{lei}->{sto}->ipc_do('done') if $self->{lei}->{sto};
+}
+
sub input_only_atfork_child {
my ($self) = @_;
my $lei = $self->{lei};