From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) 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.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 43E311FAEB for ; Thu, 22 Feb 2018 21:42:25 +0000 (UTC) From: "Eric Wong (Contractor, The Linux Foundation)" To: meta@public-inbox.org Subject: [PATCH 09/12] import_vger_from_mbox: use PublicInbox::MIME and avoid clobbering Date: Thu, 22 Feb 2018 21:42:19 +0000 Message-Id: <20180222214222.1086-10-e@80x24.org> In-Reply-To: <20180222214222.1086-1-e@80x24.org> References: <20180222214222.1086-1-e@80x24.org> List-Id: It is less confusing without the clobber assignment; and PublicInbox::MIME exists to workaround bugs in older Email::MIME (which is in Debian 9 (stretch)) --- scripts/import_vger_from_mbox | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/import_vger_from_mbox b/scripts/import_vger_from_mbox index abc2d37..1308483 100644 --- a/scripts/import_vger_from_mbox +++ b/scripts/import_vger_from_mbox @@ -46,12 +46,12 @@ my $vger = PublicInbox::Filter::Vger->new; sub do_add ($$) { my ($im, $msg) = @_; $$msg =~ s/(\r?\n)+\z/$1/s; - $msg = Email::MIME->new($$msg); - $msg = $vger->scrub($msg); + my $mime = PublicInbox::MIME->new($msg); + $mime = $vger->scrub($mime); return unless $im; - $im->add($msg) or + $im->add($mime) or warn "duplicate: ", - $msg->header_obj->header_raw('Message-ID'), "\n"; + $mime->header_obj->header_raw('Message-ID'), "\n"; } # asctime: From example@example.com Fri Jun 23 02:56:55 2000 -- EW