]> Sergey Matveev's repositories - public-inbox.git/blobdiff - script/public-inbox-init
searchidx: skip filenames on "diff --git ..."
[public-inbox.git] / script / public-inbox-init
index da683657a0b1b38fd54a44dcc35af32dbcc677b6..6221871e1bde392e618660100b36489995222d22 100755 (executable)
@@ -14,8 +14,9 @@ EOF
 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::InboxWritable;
+use PublicInbox::Config;
+use PublicInbox::InboxWritable;
+use PublicInbox::Import;
 use File::Temp qw/tempfile/;
 use PublicInbox::Lock;
 use File::Basename qw/dirname/;
@@ -23,7 +24,6 @@ use File::Path qw/mkpath/;
 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;
@@ -151,13 +151,13 @@ umask(0077) if defined $perm;
 
 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)) {
-       x(@x, "$pfx.indexlevel", $indexlevel);
+       PublicInbox::Import::run_die([@x, "$pfx.indexlevel", $indexlevel]);
 }
 
 # needed for git prior to v2.1.0