* [PATCH 2/6] lei_to_mail: get rid of empty _post_augment_maildir
2021-02-19 12:09 5% [PATCH 0/6] lei: start working on IMAP writes Eric Wong
@ 2021-02-19 12:09 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-02-19 12:09 UTC (permalink / raw)
To: meta
We won't have _post_augment_imap when we add IMAP support,
either.
_pre_augment_imap will not exist, either, since opening an
IMAP(S) connection can be time consuming so we'll roll that
into imap_common_init.
---
lib/PublicInbox/LeiToMail.pm | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/lib/PublicInbox/LeiToMail.pm b/lib/PublicInbox/LeiToMail.pm
index b90756ae..e89cca71 100644
--- a/lib/PublicInbox/LeiToMail.pm
+++ b/lib/PublicInbox/LeiToMail.pm
@@ -394,8 +394,6 @@ sub _do_augment_maildir {
}
}
-sub _post_augment_maildir {} # noop
-
sub _pre_augment_mbox {
my ($self, $lei) = @_;
my $dst = $lei->{ovv}->{dst};
@@ -441,8 +439,8 @@ sub _do_augment_mbox {
sub pre_augment { # fast (1 disk seek), runs in same process as post_augment
my ($self, $lei) = @_;
# _pre_augment_maildir, _pre_augment_mbox
- my $m = "_pre_augment_$self->{base_type}";
- $self->$m($lei);
+ my $m = $self->can("_pre_augment_$self->{base_type}") or return;
+ $m->($self, $lei);
}
sub do_augment { # slow, runs in wq worker
@@ -455,9 +453,9 @@ sub do_augment { # slow, runs in wq worker
# fast (spawn compressor or mkdir), runs in same process as pre_augment
sub post_augment {
my ($self, $lei, @args) = @_;
- # _post_augment_maildir, _post_augment_mbox
- my $m = "_post_augment_$self->{base_type}";
- $self->$m($lei, @args);
+ # _post_augment_mbox
+ my $m = $self->can("_post_augment_$self->{base_type}") or return;
+ $m->($self, $lei, @args);
}
sub ipc_atfork_child {
^ permalink raw reply related [relevance 7%]
* [PATCH 0/6] lei: start working on IMAP writes
@ 2021-02-19 12:09 5% Eric Wong
2021-02-19 12:09 7% ` [PATCH 2/6] lei_to_mail: get rid of empty _post_augment_maildir Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2021-02-19 12:09 UTC (permalink / raw)
To: meta
Testing this will be tricky and require writable access to
an existing IMAP server via TEST_IMAP_WRITE_URL env.
I don't know if I want to do a writable IMAP server for testing
(or maybe accessible via lei somehow).
4/6 is fix for a long-standing bug carried over from Watch.pm
(well, as long as -watch has had IMAP support) which was within
the past year, but it's been a long year :<)
Eric Wong (6):
t/lei-externals: favor "-o format:$PATHNAME" over "-f"
lei_to_mail: get rid of empty _post_augment_maildir
tests: require Mail::IMAPClient for IMAP tests
net_reader: handle single-message IMAP mailboxes
net_writer: start implementing IMAP write support
URIimap: overload "" to ->as_string
MANIFEST | 2 ++
lib/PublicInbox/LeiToMail.pm | 14 +++++------
lib/PublicInbox/NetReader.pm | 47 +++++++++++++++++++++--------------
lib/PublicInbox/NetWriter.pm | 26 +++++++++++++++++++
lib/PublicInbox/URIimap.pm | 1 +
t/lei-convert.t | 2 +-
t/lei-externals.t | 8 +++---
t/lei-import-imap.t | 2 +-
t/net_reader-imap.t | 2 +-
t/uri_imap.t | 1 +
xt/lei-auth-fail.t | 1 +
xt/net_writer-imap.t | 48 ++++++++++++++++++++++++++++++++++++
12 files changed, 121 insertions(+), 33 deletions(-)
create mode 100644 lib/PublicInbox/NetWriter.pm
create mode 100644 xt/net_writer-imap.t
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-02-19 12:09 5% [PATCH 0/6] lei: start working on IMAP writes Eric Wong
2021-02-19 12:09 7% ` [PATCH 2/6] lei_to_mail: get rid of empty _post_augment_maildir 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).