use PublicInbox::Eml;
use PublicInbox::ProcessPipe;
use PublicInbox::Spawn qw(spawn);
-use PublicInbox::PktOp qw(pkt_do);
use Symbol qw(gensym);
use IO::Handle; # ->autoflush
use Fcntl qw(SEEK_SET SEEK_END O_CREAT O_EXCL O_WRONLY);
my $dst = $lei->{ovv}->{dst};
my $lse = $lei->{lse}; # may be undef
my $sto = $lei->{opt}->{'mail-sync'} ? $lei->{sto} : undef;
- my $out = $sto ? 'maildir:'.$lei->rel2abs($dst) : undef;
+ my $out = $sto ? 'maildir:'.$lei->abs_path($dst) : undef;
# Favor cur/ and only write to new/ when augmenting. This
# saves MUAs from having to do a mass rename when the initial
my $fmt = $lei->{ovv}->{fmt};
my $dst = $lei->{ovv}->{dst};
my $self = bless {}, $cls;
+ my @conflict;
if ($fmt eq 'maildir') {
require PublicInbox::MdirReader;
$self->{base_type} = 'maildir';
require PublicInbox::LeiViewText;
$lei->{lvt} = PublicInbox::LeiViewText->new($lei);
$self->{base_type} = 'text';
+ @conflict = qw(mua save);
} elsif ($fmt eq 'v2') {
die "--dedupe=oid and v2 are incompatible\n" if
($lei->{opt}->{dedupe}//'') eq 'oid';
$self->{base_type} = 'v2';
$lei->{opt}->{save} = \1;
- die "--mua incompatible with v2\n" if $lei->{opt}->{mua};
$dst = $lei->{ovv}->{dst} = $lei->abs_path($dst);
+ @conflict = qw(mua sort);
} else {
die "bad mail --format=$fmt\n";
}
(-d $dst || (-e _ && !-w _)) and die
"$dst exists and is not a writable file\n";
}
- if ($self->{base_type} eq 'text') {
- my @err = map {
- defined($lei->{opt}->{$_}) ? "--$_" : ();
- } (qw(mua save));
- die "@err incompatible with $fmt\n" if @err;
- }
+ my @err = map { defined($lei->{opt}->{$_}) ? "--$_" : () } @conflict;
+ die "@err incompatible with $fmt\n" if @err;
$self->{dst} = $dst;
$lei->{dedupe} = $lei->{lss} // do {
my $dd_cls = 'PublicInbox::'.
my ($self) = @_;
my $lei = $self->{lei};
# lei_xsearch can start as soon as all l2m workers get here
- pkt_do($lei->{pkt_op_p}, 'incr_start_query') or
+ $lei->{pkt_op_p}->pkt_do('incr_start_query') or
die "incr_start_query: $!";
my $aug;
if (lock_free($self)) { # all workers do_augment
local $0 = 'do_augment';
eval { do_augment($self, $lei) };
$lei->fail($@) if $@;
- pkt_do($lei->{pkt_op_p}, $aug) == 1 or
+ $lei->{pkt_op_p}->pkt_do($aug) == 1 or
die "do_post_augment trigger: $!";
}
# done augmenting, connect the compressor pipe for each worker
sub wq_atexit_child {
my ($self) = @_;
my $lei = $self->{lei};
- if (!$self->{-wq_worker_nr} && $lei->{lcat_blob}) {
- for my $oid (@{$lei->{lcat_blob}}) {
- my $smsg = { blob => $oid, pct => 100 };
- write_mail($self, $smsg);
- }
- }
delete $self->{wcb};
$lei->{ale}->git->async_wait_all;
my $nr = delete($lei->{-nr_write}) or return;
return if $lei->{early_mua} || !$lei->{-progress} || !$lei->{pkt_op_p};
- require PublicInbox::PktOp;
- PublicInbox::PktOp::pkt_do($lei->{pkt_op_p}, 'l2m_progress', $nr);
+ $lei->{pkt_op_p}->pkt_do('l2m_progress', $nr);
}
# called in top-level lei-daemon when LeiAuth is done