]> Sergey Matveev's repositories - public-inbox.git/blobdiff - scripts/import_slrnspool
inbox: add ->version method
[public-inbox.git] / scripts / import_slrnspool
index e7ea45c1242a7f616201f4fe7718543e7730ec1b..b913cf3212d17de382ce91ba761b0c9025a58529 100755 (executable)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl -w
-# Copyright (C) 2015-2018 all contributors <meta@public-inbox.org>
+# Copyright (C) 2015-2019 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 #
 # Incremental (or one-shot) importer of a slrnpull news spool
@@ -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;
 }