1 # Copyright (C) 2019 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 # This interface wraps PublicInbox::Import and makes it closer
6 # Used to write to V1 inboxes (see L<public-inbox-v1-format(5)>).
7 package PublicInbox::V1Writable;
10 use base qw(PublicInbox::Import);
11 use PublicInbox::InboxWritable;
14 my ($class, $ibx, $creat) = @_;
15 my $dir = $ibx->{mainrepo} or die "no mainrepo in inbox\n";
18 PublicInbox::Import::init_bare($dir);
20 die "$dir does not exist\n";
23 $ibx = PublicInbox::InboxWritable->new($ibx);
24 $class->SUPER::new(undef, undef, undef, $ibx);
28 my ($self, $partitions, $skip_epoch, $skip_artnum) = @_;
29 # TODO: honor skip_artnum
30 my $dir = $self->{-inbox}->{mainrepo} or die "no mainrepo in inbox\n";
31 PublicInbox::Import::init_bare($dir);