local $current_lei = $self;
$child_error ||= 1 << 8;
warn(substr($msg, -1, 1) eq "\n" ? $msg : "$msg\n") if defined $msg;
+ $self->{child_error} ||= $child_error;
if ($self->{pkt_op_p}) { # to top lei-daemon
$self->{pkt_op_p}->pkt_do('child_error', $child_error);
} elsif ($self->{sock}) { # to lei(1) client
send($self->{sock}, "child_error $child_error", MSG_EOR);
- } else { # non-lei admin command
- $self->{child_error} ||= $child_error;
} # else noop if client disconnected
}
sub _wq_done_wait { # dwaitpid callback (via wq_eof)
my ($arg, $pid) = @_;
my ($mrr, $lei) = @$arg;
- my $f = "$mrr->{dst}/mirror.done";
if ($?) {
$lei->child_error($?);
- } elsif (!$mrr->{dry_run} && !unlink($f)) {
- warn("unlink($f): $!\n") unless $!{ENOENT};
- } else {
+ } elsif (!$lei->{child_error}) {
if (!$mrr->{dry_run} && $lei->{cmd} ne 'public-inbox-clone') {
require PublicInbox::LeiAddExternal;
PublicInbox::LeiAddExternal::_finish_add_external(
PublicInbox::Admin::index_inbox($ibx, undef, $opt);
}
return if defined $self->{cur_dst}; # one of many repos to clone
- open my $x, '>', "$self->{dst}/mirror.done"; # for _wq_done_wait
}
sub run_reap {
}
dump_manifest($m => $ft) if delete($self->{chg}->{manifest}) || $mis;
ft_rename($ft, $manifest, 0666);
- open my $x, '>', "$self->{dst}/mirror.done"; # for _wq_done_wait
}
sub start_clone_url {