]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei q: mbox*: disable changing parallelism, add --rsyncable
authorEric Wong <e@80x24.org>
Fri, 12 Mar 2021 10:39:43 +0000 (10:39 +0000)
committerEric Wong <e@80x24.org>
Sat, 13 Mar 2021 09:09:46 +0000 (05:09 -0400)
Unfortunately, being mairix-compatible with --threads means we
can't change thread-count of gzip, bzip2, or xz when writing to
compressed mbox with a --threads= parameter.  It's probably not
worth changing, anyways, so another switch or additional value
for --jobs= won't be added.

While we're in the area, add --rsyncable support since
most installations of gzip support it nowadays.

Fixes: 5beb4a5f6585acd ("lei: replace --thread with --threads")
lib/PublicInbox/LEI.pm
lib/PublicInbox/LeiToMail.pm

index 9bf60ad454aef3aa5f2208e16836d6fc1f9a7f28..59a3338c08a69a9415190546b122d06bc14eff3f 100644 (file)
@@ -113,7 +113,7 @@ our %CMD = ( # sorted in order of importance/use:
        qw(save-as=s output|mfolder|o=s format|f=s dedupe|d=s threads|t+
        sort|s=s reverse|r offset=i remote! local! external! pretty
        include|I=s@ exclude=s@ only=s@ jobs|j=s globoff|g augment|a
-       import-remote! import-before! lock=s@
+       import-remote! import-before! lock=s@ rsyncable
        alert=s@ mua=s no-torsocks torsocks=s verbose|v+ quiet|q C=s@),
        PublicInbox::LeiQuery::curl_opt(), opt_dash('limit|n=i', '[0-9]+') ],
 
index 13b4f67275b696cb1b84148f00b60bebf25562d3..13764d79fbf79433ab49af0f1853b0ffcb75988e 100644 (file)
@@ -170,9 +170,9 @@ sub reap_compress { # dwaitpid callback
 # { foo => '' } means "--foo" is passed to the command-line,
 # otherwise { foo => '--bar' } passes "--bar"
 our %zsfx2cmd = (
-       gz => [ qw(GZIP pigz gzip), { rsyncable => '', threads => '-p' } ],
+       gz => [ qw(GZIP pigz gzip), { rsyncable => '' } ],
        bz2 => [ 'bzip2', {} ],
-       xz => [ 'xz', { threads => '-T' } ],
+       xz => [ 'xz', {} ],
        # XXX does anybody care for these?  I prefer zstd on entire FSes,
        # so it's probably not necessary on a per-file basis
        # zst => [ 'zstd', { -default => [ qw(-q) ], # it's noisy by default
@@ -203,7 +203,7 @@ sub zsfx2cmd ($$$) {
                my $switch = $cmd_opt->{rsyncable} // next;
                push @cmd, '--'.($switch || $bool);
        }
-       for my $key (qw(threads)) { # support compression level?
+       for my $key (qw(rsyncable)) { # support compression level?
                my $switch = $cmd_opt->{$key} // next;
                my $val = $lei->{opt}->{$key} // next;
                push @cmd, $switch, $val;