about summary refs log tree commit homepage
path: root/script
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2018-12-28 10:16:11 +0000
committerEric Wong <e@80x24.org>2018-12-28 19:17:47 +0000
commit0e933ed9b8a751d70623f72fbee98ad77af7578c (patch)
tree65bd5a2c4ef8cec4908c645529c5417c5f0a3ec9 /script
parentc5d3dc3122323bda426de9251fcbdb2561570c42 (diff)
downloadpublic-inbox-0e933ed9b8a751d70623f72fbee98ad77af7578c.tar.gz
This allows archivists to publish incomplete archives with newer
mail while allowing "0.git" (or "1.git" and so on) epochs to be
added-after-the-fact (without affecting "git clone" followers).

A reindex will be necessary for Xapian and SQLite to catch up
once the old epochs are added; but the reindexing code is also
capable of tolerating missing epochs.
Diffstat (limited to 'script')
-rwxr-xr-xscript/public-inbox-init8
1 files changed, 7 insertions, 1 deletions
diff --git a/script/public-inbox-init b/script/public-inbox-init
index 1aec799c..39f7497f 100755
--- a/script/public-inbox-init
+++ b/script/public-inbox-init
@@ -17,8 +17,10 @@ sub x { system(@_) and die join(' ', @_). " failed: $?\n" }
 sub usage { print STDERR "Usage: $usage\n"; exit 1 }
 my $version = undef;
 my $indexlevel = undef;
+my $skip;
 my %opts = ( 'V|version=i' => \$version,
              'L|indexlevel=s' => \$indexlevel,
+             'S|skip=i' => \$skip,
 );
 GetOptions(%opts) or usage();
 my $name = shift @ARGV or usage();
@@ -97,6 +99,10 @@ if (-f "$mainrepo/inbox.lock") {
 
 $version = 1 unless defined $version;
 
+if ($version == 1 && defined $skip) {
+        die "--skip is only supported for -V2 repos\n";
+}
+
 if ($version >= 2) {
         require PublicInbox::V2Writable;
         require PublicInbox::Inbox;
@@ -107,7 +113,7 @@ if ($version >= 2) {
                 -primary_address => $address[0],
         };
         $ibx = PublicInbox::Inbox->new($ibx);
-        PublicInbox::V2Writable->new($ibx, 1)->init_inbox(0);
+        PublicInbox::V2Writable->new($ibx, 1)->init_inbox(0, $skip);
 } elsif ($version == 1) {
         x(qw(git init -q --bare), $mainrepo);