user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 3/3] lei q: mbox*: disable changing parallelism, add --rsyncable
Date: Fri, 12 Mar 2021 10:39:43 +0000	[thread overview]
Message-ID: <20210312103943.4783-4-e@80x24.org> (raw)
In-Reply-To: <20210312103943.4783-1-e@80x24.org>

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       | 2 +-
 lib/PublicInbox/LeiToMail.pm | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index 9bf60ad4..59a3338c 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -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]+') ],
 
diff --git a/lib/PublicInbox/LeiToMail.pm b/lib/PublicInbox/LeiToMail.pm
index 13b4f672..13764d79 100644
--- a/lib/PublicInbox/LeiToMail.pm
+++ b/lib/PublicInbox/LeiToMail.pm
@@ -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;

      parent reply	other threads:[~2021-03-12 10:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12 10:39 [PATCH 0/3] lei CLI option updates Eric Wong
2021-03-12 10:39 ` [PATCH 1/3] lei: add help + completion for --no-external Eric Wong
2021-03-12 10:39 ` [PATCH 2/3] lei: rearrange OPT_DESC and drop some TBD switches Eric Wong
2021-03-12 10:39 ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210312103943.4783-4-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).