X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=blobdiff_plain;f=scripts%2Fimport_slrnspool;h=d9a35dfdfa86b817018540bf3450ffbbbf289f94;hp=25b702a05de7fa2948f5baa9c0c721e0b1d469ab;hb=0ae89efce11e1e3b10a067c61c5b4cde30fa2b3b;hpb=a7a5bfc80f4b5ffe2676bdd68ceb8f42a6a21e22 diff --git a/scripts/import_slrnspool b/scripts/import_slrnspool index 25b702a0..d9a35dfd 100755 --- a/scripts/import_slrnspool +++ b/scripts/import_slrnspool @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# Copyright (C) 2015-2018 all contributors +# Copyright (C) 2015-2021 all contributors # License: AGPL-3.0+ # # Incremental (or one-shot) importer of a slrnpull news spool @@ -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`)) } @@ -22,11 +22,11 @@ $SIG{TERM} = $sighandler; my $spool = shift @ARGV or die usage(); my $recipient = $ENV{ORIGINAL_RECIPIENT}; defined $recipient or die usage(); -my $config = PublicInbox::Config->new; -my $ibx = $config->lookup($recipient); +my $cfg = PublicInbox::Config->new; +my $ibx = $cfg->lookup($recipient); my $git = $ibx->git; my $im; -if (($ibx->{version} || 1) == 2) { +if ($ibx->version == 2) { require PublicInbox::V2Writable; $im = PublicInbox::V2Writable->new($ibx); $im->{parallel} = 0; # pointless to be parallel for a single message @@ -70,7 +70,7 @@ for (; $exit == 0 && $n < $max; $n++) { $max = $n + $max_gap; print STDERR $fn, "\n"; - my $mime = PublicInbox::MIME->new(eval { local $/; <$fh> }); + my $mime = PublicInbox::Eml->new(do { local $/; <$fh> }); $filter->scrub($mime); $im->add($mime);