]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiUp.pm
lei up --all: show output for warnings
[public-inbox.git] / lib / PublicInbox / LeiUp.pm
index 377a720eaf29202ab82ed87a0a99d70299ea774c..3011300dd8369b1f9ff36894e5b5c70cb394c0b3 100644 (file)
@@ -32,7 +32,7 @@ sub up1 ($$) {
                $lei->{opt}->{$k} //= $v;
        }
        for my $k ($lss->BOOL_FIELDS, $lss->SINGLE_FIELDS) {
-               my $v = $lss->{-cfg}->get_1('lei.q', $k) // next;
+               my $v = $lss->{-cfg}->get_1("lei.q.$k") // next;
                $lei->{opt}->{$k} //= $v;
        }
        my $o = $lei->{opt}->{output} // '';
@@ -159,6 +159,13 @@ sub event_step { # runs via PublicInbox::DS::requeue
        delete $l->{opt}->{all};
        $l->qerr("# updating $self->{out}");
        $l->{up_op_p} = $self->{op_p}; # ($l => $lei => script/lei)
+       my $cb = $SIG{__WARN__} // \&CORE::warn;
+       my $o = " (output: $self->{out})";
+       local $SIG{__WARN__} = sub {
+               my @m = @_;
+               push(@m, $o) if !@m || $m[-1] !~ s/\n\z/$o\n/;
+               $cb->(@m);
+       };
        eval { $l->dispatch('up', $self->{out}) };
        $lei->child_error(0, $@) if $@ || $l->{failed}; # lei->fail()