From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id E192D1FB06 for ; Fri, 17 Sep 2021 01:56:44 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH v2 4/6] lei refresh-mail-sync: drop unused {verify} code path Date: Thu, 16 Sep 2021 20:56:42 -0500 Message-Id: <20210917015644.32746-5-e@80x24.org> In-Reply-To: <20210917015644.32746-1-e@80x24.org> References: <20210917015644.32746-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: That option was never wired up, and probably not needed... --- lib/PublicInbox/LeiRefreshMailSync.pm | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/lib/PublicInbox/LeiRefreshMailSync.pm b/lib/PublicInbox/LeiRefreshMailSync.pm index 71fc348c..4cae1536 100644 --- a/lib/PublicInbox/LeiRefreshMailSync.pm +++ b/lib/PublicInbox/LeiRefreshMailSync.pm @@ -9,27 +9,12 @@ use v5.10.1; use parent qw(PublicInbox::IPC PublicInbox::LeiInput); use PublicInbox::LeiExportKw; use PublicInbox::InboxWritable qw(eml_from_path); -use PublicInbox::ContentHash qw(git_sha); use PublicInbox::Import; -sub eml_match ($$) { - my ($eml, $oidbin) = @_; - $eml->header_set($_) for @PublicInbox::Import::UNWANTED_HEADERS; - $oidbin eq git_sha(length($oidbin) == 20 ? 1 : 256, $eml)->digest; -} - sub prune_mdir { # lms->each_src callback my ($oidbin, $id, $self, $mdir) = @_; my @try = $$id =~ /:2,[a-zA-Z]*\z/ ? qw(cur new) : qw(new cur); - for my $d (@try) { - my $src = "$mdir/$d/$$id"; - if ($self->{verify}) { - my $eml = eml_from_path($src) // next; - return if eml_match($eml, $oidbin); - } elsif (-f $src) { - return; - } - } + for (@try) { return if -f "$mdir/$_/$$id" } # both tries failed $self->{lei}->{sto}->ipc_do('lms_clear_src', "maildir:$mdir", $id); }