From 96a27a0a073b61c465240bbbbb05a4c16f67c8d4 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 23 May 2019 09:36:40 +0000 Subject: v1writable: retire in favor of InboxWritable In retrospect, introducing V1Writable was unnecessary and InboxWritable->importer is in a better position to abstract away differences between v1 and v2 writers. So teach InboxWritable to initialize inboxes and get rid of V1Writable. --- script/public-inbox-init | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'script') diff --git a/script/public-inbox-init b/script/public-inbox-init index 2cc704ce..5724c52a 100755 --- a/script/public-inbox-init +++ b/script/public-inbox-init @@ -10,7 +10,7 @@ use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/; use PublicInbox::Admin; PublicInbox::Admin::require_or_die('-base'); require PublicInbox::Config; -require PublicInbox::Inbox; +require PublicInbox::InboxWritable; use File::Temp qw/tempfile/; use File::Basename qw/dirname/; use File::Path qw/mkpath/; @@ -116,15 +116,8 @@ my $ibx = PublicInbox::Inbox->new({ indexlevel => $indexlevel, }); -if ($version >= 2) { - require PublicInbox::V2Writable; - PublicInbox::V2Writable->new($ibx, 1)->init_inbox(0, $skip); -} elsif ($version == 1) { - require PublicInbox::V1Writable; - PublicInbox::V1Writable->new($ibx, 1)->init_inbox(0, $skip); -} else { - die "Unsupported -V/--version: $version\n"; -} +my $creat_opt = {}; +PublicInbox::InboxWritable->new($ibx, $creat_opt)->init_inbox(0, $skip); # needed for git prior to v2.1.0 umask(0077) if defined $perm; -- cgit v1.2.3-24-ge0c7