lib/PublicInbox/LeiMirror.pm | 13 ++++++++++--- diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm index 92156cf1cca8b250675bbbebba67971059ac7459..9843d1a67e3ab964d8e08a78d583a5ec4afcf527 100644 --- a/lib/PublicInbox/LeiMirror.pm +++ b/lib/PublicInbox/LeiMirror.pm @@ -461,7 +461,11 @@ }, __PACKAGE__; } sub fp_done { - my ($self, $cb, @arg) = @_; + my ($self, $cmd, $cb, @arg) = @_; + if ($?) { + $self->{lei}->err("@$cmd failed (\$?=$?) (non-fatal)"); + $? = 0; # don't let it influence normal exit + } return if !keep_going($self); my $fh = delete $self->{-show_ref} // die 'BUG: no show-ref output'; seek($fh, SEEK_SET, 0) or die "seek(show_ref): $!"; @@ -487,8 +491,11 @@ my $cmd = ['git', "--git-dir=$dst", 'show-ref']; my $opt = { 2 => $self->{lei}->{2} }; open($opt->{1}, '+>', undef) or die "open(tmp): $!"; $self->{-show_ref} = $opt->{1}; - my $done = PublicInbox::OnDestroy->new($$, \&fp_done, $self, $cb, @arg); - start_cmd($self, $cmd, $opt, $done); + do_reap($self); + $self->{lei}->qerr("# @$cmd"); + return if $self->{dry_run}; + $LIVE->{spawn($cmd, undef, $opt)} = [ \&fp_done, $self, $cmd, + $cb, @arg ]; } sub resume_fetch {