about summary refs log tree commit homepage
path: root/script
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-11-28 05:31:17 +0000
committerEric Wong <e@80x24.org>2022-11-28 23:38:54 +0000
commit1c3d7bd75e2c6f84bd511a17838fa9113c98578c (patch)
treefffd3d89e2b42af49e5e06ebcd14de5e89e10150 /script
parent74fe3d0dc688202adc634cfc6a9e57f1aa28d85d (diff)
downloadpublic-inbox-1c3d7bd75e2c6f84bd511a17838fa9113c98578c.tar.gz
It still makes HTTP(S) requests to retrieve the manifest or
scrape HTML, but doesn't make permanent changes to the FS
(aside from modifying {acm}time of ${TMPDIR-/tmp}).
Diffstat (limited to 'script')
-rwxr-xr-xscript/public-inbox-clone6
1 files changed, 5 insertions, 1 deletions
diff --git a/script/public-inbox-clone b/script/public-inbox-clone
index ce4697f3..22ffc0fc 100755
--- a/script/public-inbox-clone
+++ b/script/public-inbox-clone
@@ -17,12 +17,13 @@ options:
   --torsocks VAL      whether or not to wrap git and curl commands with
                       torsocks (default: `auto')
                       Must be one of: `auto', `no' or `yes'
+  --dry-run | -n      show what would be cloned without cloning
   --verbose | -v      increase verbosity (may be repeated)
     --quiet | -q      increase verbosity (may be repeated)
     -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@
-                jobs|j=i no-torsocks torsocks=s epoch=s)) or die $help;
+        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
 PublicInbox::Admin::do_chdir(delete $opt->{C});
@@ -54,6 +55,9 @@ my $mrr = bless {
         src => $url,
         dst => $dst,
 }, '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);