X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=scripts%2Fimport_slrnspool;h=bdcc605c245434bc5ca6c47524d09ce6aef45147;hb=43b66634d508a1cd81023b5d567abae3804420c4;hp=e7ea45c1242a7f616201f4fe7718543e7730ec1b;hpb=7715c70e5a8667fbd9eade0cffb6ab05a714dd5d;p=public-inbox.git
diff --git a/scripts/import_slrnspool b/scripts/import_slrnspool
index e7ea45c1..bdcc605c 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-2020 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`)) }
@@ -26,7 +26,7 @@ my $config = PublicInbox::Config->new;
my $ibx = $config->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
@@ -47,7 +47,7 @@ sub get_min {
my $out = $git->qx('config', "--file=$f", key($ibx));
$out ||= 0;
chomp $out;
- $out =~ /\A\d+\z/ and return $out;
+ $out =~ /\A[0-9]+\z/ and return $out;
0;
}
@@ -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);