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-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 9461D1F9FD; Fri, 26 Feb 2021 21:03:35 +0000 (UTC) Date: Fri, 26 Feb 2021 17:03:34 -0400 From: Eric Wong To: meta@public-inbox.org Subject: [SQUASH 6/5] require MboxLock even for .eml files Message-ID: References: <20210226094141.11514-1-e@80x24.org> <20210226094141.11514-4-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210226094141.11514-4-e@80x24.org> List-Id: We rely on MboxLock->acq to open .eml files, at the moment (which may not be a great idea, but it's the most natural from the current callers perspective). diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index e133b357..0da24499 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -410,12 +410,12 @@ sub check_input_format ($;$) { my $err = $files ? "regular file(s):\n@$files" : '--stdin'; return fail($self, "--$opt_key unset for $err"); } + require PublicInbox::MboxLock if $files; return 1 if $fmt eq 'eml'; # XXX: should this handle {gz,bz2,xz}? that's currently in LeiToMail require PublicInbox::MboxReader; PublicInbox::MboxReader->can($fmt) or return fail($self, "--$opt_key=$fmt unrecognized"); - require PublicInbox::MboxLock if $files; 1; }