user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 2/5] mdir_reader: maildir_each_file: pass flags, skip Trash
  2021-06-09  7:47  7% [PATCH 0/5] lei Maildir stuff Eric Wong
@ 2021-06-09  7:47  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-06-09  7:47 UTC (permalink / raw)
  To: meta

This is a slight behavior change for "lei q": Trashed
(but not-yet-expunged) messages no longer get unlinked
when --output is used without --augment.
---
 lib/PublicInbox/LeiImport.pm  | 4 +---
 lib/PublicInbox/LeiPmdir.pm   | 8 ++++----
 lib/PublicInbox/MdirReader.pm | 5 +++--
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/lib/PublicInbox/LeiImport.pm b/lib/PublicInbox/LeiImport.pm
index b0e7ba6b..cddd5619 100644
--- a/lib/PublicInbox/LeiImport.pm
+++ b/lib/PublicInbox/LeiImport.pm
@@ -30,11 +30,9 @@ sub input_mbox_cb { # MboxReader callback
 }
 
 sub pmdir_cb { # called via wq_io_do from LeiPmdir->each_mdir_fn
-	my ($self, $f, @args) = @_;
+	my ($self, $f, $fl) = @_;
 	my ($folder, $bn) = ($f =~ m!\A(.+?)/(?:new|cur)/([^/]+)\z!) or
 		die "BUG: $f was not from a Maildir?\n";
-	my $fl = PublicInbox::MdirReader::maildir_basename_flags($bn);
-	return if index($fl, 'T') >= 0; # no Trashed messages
 	my $kw = PublicInbox::MdirReader::flags2kw($fl);
 	substr($folder, 0, 0) = 'maildir:'; # add prefix
 	my $lms = $self->{-lms_ro};
diff --git a/lib/PublicInbox/LeiPmdir.pm b/lib/PublicInbox/LeiPmdir.pm
index b71efe70..aa9ce713 100644
--- a/lib/PublicInbox/LeiPmdir.pm
+++ b/lib/PublicInbox/LeiPmdir.pm
@@ -42,13 +42,13 @@ sub ipc_atfork_child {
 }
 
 sub each_mdir_fn { # maildir_each_file callback
-	my ($f, $self, @args) = @_;
-	$self->wq_io_do('mdir_iter', [], $f, @args);
+	my ($f, $fl, $self, @args) = @_;
+	$self->wq_io_do('mdir_iter', [], $f, $fl, @args);
 }
 
 sub mdir_iter { # via wq_io_do
-	my ($self, $f, @args) = @_;
-	$self->{ipt}->pmdir_cb($f, @args);
+	my ($self, $f, $fl, @args) = @_;
+	$self->{ipt}->pmdir_cb($f, $fl, @args);
 }
 
 sub pmd_done_wait {
diff --git a/lib/PublicInbox/MdirReader.pm b/lib/PublicInbox/MdirReader.pm
index 484bf0a8..dbb74d6d 100644
--- a/lib/PublicInbox/MdirReader.pm
+++ b/lib/PublicInbox/MdirReader.pm
@@ -42,9 +42,10 @@ sub maildir_each_file {
 		my $pfx = $dir.$d;
 		opendir my $dh, $pfx or next;
 		while (defined(my $bn = readdir($dh))) {
-			maildir_basename_flags($bn) // next;
+			my $fl = maildir_basename_flags($bn) // next;
 			next if defined($mod) && !shard_ok($bn, $mod, $shard);
-			$cb->($pfx.$bn, @arg);
+			next if index($fl, 'T') >= 0; # no Trashed messages
+			$cb->($pfx.$bn, $fl, @arg);
 		}
 	}
 }

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/5] lei Maildir stuff
@ 2021-06-09  7:47  7% Eric Wong
  2021-06-09  7:47  7% ` [PATCH 2/5] mdir_reader: maildir_each_file: pass flags, skip Trash Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-06-09  7:47 UTC (permalink / raw)
  To: meta

I'm not sure if "prune-mail-sync" needs to be exposed, but I
suppose it could be useful in some cases.  It's certainly easier
to implement.

"lei tag" gets a nice speedup for Maildirs, IMAP speedup is
probably better off done after we get IMAP pipelining far into
the future.

Not sure if anybody is using InboxWritable->import_maildir...

Eric Wong (5):
  inbox_writable: fix import_maildir
  mdir_reader: maildir_each_file: pass flags, skip Trash
  lei tag: parallelize Maildir access
  lei_mail_sync: hoist out --all handling from export-kw
  lei prune-mail-sync: new command to prune invalid sync data

 MANIFEST                            |  1 +
 lib/PublicInbox/InboxWritable.pm    | 15 ++---
 lib/PublicInbox/LEI.pm              |  2 +
 lib/PublicInbox/LeiExportKw.pm      | 32 +---------
 lib/PublicInbox/LeiImport.pm        | 12 ++--
 lib/PublicInbox/LeiMailSync.pm      | 36 +++++++++++
 lib/PublicInbox/LeiPmdir.pm         | 18 ++----
 lib/PublicInbox/LeiPruneMailSync.pm | 97 +++++++++++++++++++++++++++++
 lib/PublicInbox/LeiTag.pm           |  8 ++-
 lib/PublicInbox/MdirReader.pm       |  5 +-
 lib/PublicInbox/NetReader.pm        | 19 ++++++
 lib/PublicInbox/NetWriter.pm        | 21 +------
 12 files changed, 184 insertions(+), 82 deletions(-)
 create mode 100644 lib/PublicInbox/LeiPruneMailSync.pm


^ permalink raw reply	[relevance 7%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-06-09  7:47  7% [PATCH 0/5] lei Maildir stuff Eric Wong
2021-06-09  7:47  7% ` [PATCH 2/5] mdir_reader: maildir_each_file: pass flags, skip Trash Eric Wong

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).