]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiInput.pm
lei_input: support compressed mboxes
[public-inbox.git] / lib / PublicInbox / LeiInput.pm
index c04fc2f84d1566bc1a609fe5b771d27ca3fb8761..505b73ff6df0a8c27ef8c12ed581252e90f93b6d 100644 (file)
@@ -75,6 +75,13 @@ sub input_path_url {
                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';