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 2442A1F55B for ; Tue, 19 May 2020 09:06:58 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] scripts/import_*: remove PublicInbox::MIME usage Date: Tue, 19 May 2020 09:06:58 +0000 Message-Id: <20200519090658.31271-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: These aren't really supported and will probably be replaced with better tools, but PublicInbox::Eml should be readily available to anybody who already has our source tree. --- scripts/import_maildir | 7 +++---- scripts/import_slrnspool | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/import_maildir b/scripts/import_maildir index f4e82543..269f2550 100755 --- a/scripts/import_maildir +++ b/scripts/import_maildir @@ -11,9 +11,8 @@ =cut use strict; use warnings; -use Email::Simple; use Date::Parse qw/str2time/; -use PublicInbox::MIME; +use PublicInbox::Eml; use PublicInbox::Git; use PublicInbox::Import; sub usage { "Usage:\n".join('', grep(/\t/, `head -n 24 $0`)) } @@ -28,7 +27,7 @@ my @msgs; foreach my $sub (qw(cur new)) { foreach my $fn (glob("$dir/$sub/*")) { open my $fh, '<', $fn or next; - my $s = Email::Simple->new(do { local $/; <$fh> }); + my $s = PublicInbox::Eml->new(do { local $/; <$fh> }); my $date = $s->header('Date'); my $t = eval { str2time($date) }; defined $t or next; @@ -45,7 +44,7 @@ my $im = PublicInbox::Import->new($git, $name, $email); while (my $ary = pop @msgs) { my $fn = "$dir/$ary->[1]"; open my $fh, '<', $fn or next; - my $mime = PublicInbox::MIME->new(do { local $/; <$fh> }); + my $mime = PublicInbox::Eml->new(do { local $/; <$fh> }); $im->add($mime); } $im->done; diff --git a/scripts/import_slrnspool b/scripts/import_slrnspool index 480e7b4f..bdcc605c 100755 --- a/scripts/import_slrnspool +++ b/scripts/import_slrnspool @@ -11,7 +11,7 @@ use strict; use warnings; use PublicInbox::Config; -use PublicInbox::MIME; +use PublicInbox::Eml; use PublicInbox::Import; use PublicInbox::Git; sub usage { "Usage:\n".join('',grep(/\t/, `head -n 10 $0`)) } @@ -70,7 +70,7 @@ for (; $exit == 0 && $n < $max; $n++) { $max = $n + $max_gap; print STDERR $fn, "\n"; - my $mime = PublicInbox::MIME->new(do { local $/; <$fh> }); + my $mime = PublicInbox::Eml->new(do { local $/; <$fh> }); $filter->scrub($mime); $im->add($mime);