]> Sergey Matveev's repositories - public-inbox.git/blobdiff - script/public-inbox-clone
clone: use v5.12
[public-inbox.git] / script / public-inbox-clone
index 2900f2329549a1797786c5072a28d251e992b6a6..26f42e74b8f82d2cfb9835df328bdcb1b1fe4979 100755 (executable)
@@ -2,8 +2,7 @@
 # Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 # Wrapper to git clone remote public-inboxes
-use strict;
-use v5.10.1;
+use v5.12;
 use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_abbrev);
 my $opt = {};
 my $help = <<EOF; # the following should fit w/o scrolling in 80x24 term:
@@ -14,6 +13,7 @@ usage: public-inbox-clone INBOX_URL [DESTINATION]
 options:
 
   --epoch=RANGE       range of v2 epochs to clone (e.g `2..5', `~0', `~1..')
+  --objstore [DIR]    share storage for coderepos
   --torsocks VAL      whether or not to wrap git and curl commands with
                       torsocks (default: `auto')
                       Must be one of: `auto', `no' or `yes'
@@ -23,7 +23,7 @@ options:
     -C DIR            chdir to specified directory
 EOF
 GetOptions($opt, qw(help|h quiet|q verbose|v+ C=s@ c=s@ include|I=s@ exclude=s@
-       inbox-config=s inbox-version=i
+       inbox-config=s inbox-version=i objstore:s
        dry-run|n jobs|j=i no-torsocks torsocks=s epoch=s)) or die $help;
 if ($opt->{help}) { print $help; exit };
 require PublicInbox::Admin; # loads Config
@@ -37,12 +37,9 @@ defined($dst) or ($dst) = ($url =~ m!/([^/]+)/?\z!);
 index($dst, "\n") >= 0 and die "`\\n' not allowed in `$dst'";
 
 # n.b. this is still a truckload of code...
-require URI;
 require PublicInbox::LEI;
 require PublicInbox::LeiExternal;
 require PublicInbox::LeiMirror;
-require PublicInbox::LeiCurl;
-require PublicInbox::Lock;
 
 $url = PublicInbox::LeiExternal::ext_canonicalize($url);
 my $lei = bless {
@@ -58,7 +55,6 @@ my $mrr = bless {
 }, 'PublicInbox::LeiMirror';
 
 $? = 0;
-$mrr->{dry_run} = 1 if $lei->{opt}->{'dry-run'};
 $mrr->do_mirror;
 $mrr->can('_wq_done_wait')->([$mrr, $lei], $$);
 exit(($lei->{child_error} // 0) >> 8);