]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiInput.pm
lei_input: common net_merge_all_done for lei <import|tag>
[public-inbox.git] / lib / PublicInbox / LeiInput.pm
index 86f300c3a572438ac01e475ecaca2ad58c419011..917f682ba97961c2d35e20935d0e8b69926fd1f9 100644 (file)
@@ -204,7 +204,7 @@ sub prepare_http_input ($$$) {
 sub prepare_inputs { # returns undef on error
        my ($self, $lei, $inputs) = @_;
        my $in_fmt = $lei->{opt}->{'in-format'};
-       my $sync = $lei->{opt}->{sync} ? {} : undef; # using LeiMailSync
+       my $sync = $lei->{opt}->{'mail-sync'} ? {} : undef; # using LeiMailSync
        if ($lei->{opt}->{stdin}) {
                @$inputs and return
                        $lei->fail("--stdin and @$inputs do not mix");
@@ -286,11 +286,11 @@ $input is `eml', not --in-format=$in_fmt
        }
        if ($sync && $sync->{no}) {
                return $lei->fail(<<"") if !$sync->{ok};
---sync specified but no inputs support it
+--mail-sync specified but no inputs support it
 
                # non-fatal if some inputs support support sync
-               $lei->err("# --sync will only be used for @{$sync->{ok}}");
-               $lei->err("# --sync is not supported for: @{$sync->{no}}");
+               $lei->err("# --mail-sync will only be used for @{$sync->{ok}}");
+               $lei->err("# --mail-sync is not supported for: @{$sync->{no}}");
        }
        if ($net) {
                $net->{-can_die} = 1;
@@ -329,6 +329,13 @@ sub input_only_atfork_child {
        undef;
 }
 
+# alias this as "net_merge_all_done" to use as an LeiAuth callback
+sub input_only_net_merge_all_done {
+       my ($self) = @_;
+       $self->wq_io_do('process_inputs');
+       $self->wq_close(1);
+}
+
 # like Getopt::Long, but for +kw:FOO and -kw:FOO to prepare
 # for update_xvmd -> update_vmd
 sub vmd_mod_extract {