use strict;
use v5.10.1;
use parent qw(PublicInbox::IPC);
-use PublicInbox::Config;
use IO::Uncompress::Gunzip qw(gunzip $GunzipError);
use IO::Compress::Gzip qw(gzip $GzipError);
use PublicInbox::Spawn qw(popen_rd spawn);
use File::Temp ();
use Fcntl qw(SEEK_SET O_CREAT O_EXCL O_WRONLY);
use Carp qw(croak);
-our %LIVE;
+use URI;
+use PublicInbox::Config;
+use PublicInbox::Inbox;
+use PublicInbox::LeiCurl;
+use PublicInbox::OnDestroy;
+
+our %LIVE; # pid => callback
sub _wq_done_wait { # dwaitpid callback (via wq_eof)
my ($arg, $pid) = @_;
# n.b. public-inbox-clone works w/o (SQLite || Xapian)
# lei is useless without Xapian + SQLite
if ($lei->{cmd} ne 'public-inbox-clone') {
+ require PublicInbox::InboxWritable;
+ require PublicInbox::Admin;
my $ibx = delete($self->{ibx}) // {
address => [ 'lei@example.com' ],
version => $iv,
$self->{-culled_manifest} = 1 if delete(@$m{@skip});
-d $dst || File::Path::mkpath($dst);
+ require PublicInbox::Lock;
my $lk = bless { lock_path => "$dst/inbox.lock" }, 'PublicInbox::Lock';
my $fini = PublicInbox::OnDestroy->new($$, \&v2_done, $task);
sub start {
my ($cls, $lei, $src, $dst) = @_;
my $self = bless { src => $src, dst => $dst }, $cls;
- if ($src =~ m!https?://!) {
- require URI;
- require PublicInbox::LeiCurl;
- }
- require PublicInbox::Lock;
- require PublicInbox::Inbox;
- require PublicInbox::Admin;
- require PublicInbox::InboxWritable;
$lei->request_umask;
my ($op_c, $ops) = $lei->workers_start($self, 1);
$lei->{wq1} = $self;