We already load PublicInbox::Import via
PublicInbox::InboxWritable, so it's not an extra module
to load. This can give us a slight speedup in tests.
PublicInbox::Admin::require_or_die('-base');
use PublicInbox::Config;
use PublicInbox::InboxWritable;
PublicInbox::Admin::require_or_die('-base');
use PublicInbox::Config;
use PublicInbox::InboxWritable;
+use PublicInbox::Import;
use File::Temp qw/tempfile/;
use PublicInbox::Lock;
use File::Basename qw/dirname/;
use File::Temp qw/tempfile/;
use PublicInbox::Lock;
use File::Basename qw/dirname/;
use Fcntl qw(:DEFAULT);
use Cwd qw/abs_path/;
use Fcntl qw(:DEFAULT);
use Cwd qw/abs_path/;
-sub x { system(@_) and die join(' ', @_). " failed: $?\n" }
my $version = undef;
my $indexlevel = undef;
my $skip_epoch;
my $version = undef;
my $indexlevel = undef;
my $skip_epoch;
foreach my $addr (@address) {
next if $seen{lc($addr)};
foreach my $addr (@address) {
next if $seen{lc($addr)};
- x(@x, "--add", "$pfx.address", $addr);
+ PublicInbox::Import::run_die([@x, "--add", "$pfx.address", $addr]);
-x(@x, "$pfx.url", $http_url);
-x(@x, "$pfx.inboxdir", $inboxdir);
+PublicInbox::Import::run_die([@x, "$pfx.url", $http_url]);
+PublicInbox::Import::run_die([@x, "$pfx.inboxdir", $inboxdir]);
if (defined($indexlevel)) {
if (defined($indexlevel)) {
- x(@x, "$pfx.indexlevel", $indexlevel);
+ PublicInbox::Import::run_die([@x, "$pfx.indexlevel", $indexlevel]);
}
# needed for git prior to v2.1.0
}
# needed for git prior to v2.1.0