]> Sergey Matveev's repositories - public-inbox.git/blobdiff - script/public-inbox-convert
inbox: add ->version method
[public-inbox.git] / script / public-inbox-convert
index 9bee5e7a323b437eaa0c6077458879a0b2464301..56a810eb054ffc1ea41585eab1052dabb0b7bc12 100755 (executable)
@@ -4,11 +4,9 @@
 use strict;
 use warnings;
 use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_abbrev);
-use PublicInbox::MIME;
 use PublicInbox::InboxWritable;
 use PublicInbox::Config;
 use PublicInbox::V2Writable;
-use PublicInbox::Import;
 use PublicInbox::Spawn qw(spawn);
 use Cwd 'abs_path';
 use File::Copy 'cp'; # preserves permissions:
@@ -43,7 +41,7 @@ unless ($old) {
        $old = PublicInbox::Inbox->new($old);
 }
 $old = PublicInbox::InboxWritable->new($old);
-if (($old->{version} || 1) >= 2) {
+if ($old->version >= 2) {
        die "Only conversion from v1 inboxes is supported\n";
 }
 my $new = { %$old };