]> Sergey Matveev's repositories - public-inbox.git/commitdiff
config: support "inboxdir" in addition to "mainrepo"
authorEric Wong <e@80x24.org>
Wed, 16 Oct 2019 08:59:55 +0000 (08:59 +0000)
committerEric Wong <e@80x24.org>
Wed, 16 Oct 2019 09:00:26 +0000 (09:00 +0000)
"mainrepo" ws a bad name and artifact from the early days when I
intended for there to be a "spamrepo" (now just the
ENV{PI_EMERGENCY} Maildir).  With v2, "mainrepo" can be
especially confusing, since v2 needs at least two git
repositories (epoch + all.git) to function and we shouldn't
confuse users by having them point to a git repository for v2.

Much of our documentation already references "INBOX_DIR" for
command-line arguments, so use "inboxdir" as the
git-config(1)-friendly variant for that.

"mainrepo" remains supported indefinitely for compatibility.
Users may need to revert to old versions, or may be referring
to old documentation and must not be forced to change config
files to account for this change.

So if you're using "mainrepo" today, I do NOT recommend changing
it right away because other bugs can lurk.

Link: https://public-inbox.org/meta/874l0ice8v.fsf@alyssa.is/
72 files changed:
Documentation/public-inbox-config.pod
Documentation/public-inbox-convert.pod
Documentation/public-inbox-init.pod
Documentation/public-inbox-watch.pod
examples/public-inbox-config
lib/PublicInbox/Admin.pm
lib/PublicInbox/AdminEdit.pm
lib/PublicInbox/AltId.pm
lib/PublicInbox/Config.pm
lib/PublicInbox/Inbox.pm
lib/PublicInbox/InboxWritable.pm
lib/PublicInbox/Search.pm
lib/PublicInbox/SearchIdx.pm
lib/PublicInbox/V2Writable.pm
lib/PublicInbox/WwwAtomStream.pm
lib/PublicInbox/WwwListing.pm
lib/PublicInbox/WwwStream.pm
lib/PublicInbox/WwwText.pm
lib/PublicInbox/Xapcmd.pm
script/public-inbox-convert
script/public-inbox-edit
script/public-inbox-init
script/public-inbox-mda
scripts/dupe-finder
scripts/import_vger_from_mbox
t/admin.t
t/altid.t
t/altid_v2.t
t/cgi.t
t/config.t
t/config_limiter.t
t/convert-compact.t
t/edit.t
t/feed.t
t/filter_rubylang.t
t/html_index.t
t/indexlevels-mirror.t
t/mda.t
t/mda_filter_rubylang.t
t/nntp.t
t/nntpd-tls.t
t/nntpd-validate.t
t/nntpd.t
t/perf-msgview.t
t/perf-nntpd.t
t/perf-threading.t
t/plack.t
t/psgi_attach.t
t/psgi_bad_mids.t
t/psgi_mount.t
t/psgi_multipart_not.t
t/psgi_scan_all.t
t/psgi_search.t
t/psgi_text.t
t/psgi_v2.t
t/purge.t
t/replace.t
t/search-thr-index.t
t/search.t
t/solver_git.t
t/v1-add-remove-add.t
t/v1reindex.t
t/v2-add-remove-add.t
t/v2mda.t
t/v2mirror.t
t/v2reindex.t
t/v2writable.t
t/watch_filter_rubylang.t
t/watch_maildir.t
t/watch_maildir_v2.t
t/www_listing.t
t/xcpdb-reshard.t

index 6a9739f71433c85ac8bba39ea8e0a0a11b0de5a0..1c5ba015e60c7f6cef4762e8e8d4aa575df4f876 100644 (file)
@@ -17,13 +17,17 @@ all public-inboxes used by a particular user.
 =head2 EXAMPLE
 
        [publicinbox "test"]
-               mainrepo = /home/user/path/to/test.git
+               inboxdir = /home/user/path/to/test.git
                ; multiple addresses are supported
                address = test@example.com
                ; address = alternate@example.com
                url = http://example.com/test
                newsgroup = inbox.test
 
+               ; backwards compatibility with public-inbox pre-1.2.0,
+               ; "inboxdir" takes precedence over "mainrepo"
+               mainrepo = /home/user/path/to/test.git
+
 =head2 VARIABLES
 
 =over 8
@@ -38,11 +42,14 @@ informational purposes.
 
 Default: none, required
 
-=item publicinbox.<name>.mainrepo
+=item publicinbox.<name>.inboxdir
 
 The absolute path to the directory which hosts the
 public-inbox.  This must be specified once.
 
+This was previously known as "mainrepo", which remains supported,
+but "inboxdir" takes precedence.
+
 Default: none, required
 
 =item publicinbox.<name>.url
@@ -373,20 +380,20 @@ RLIMIT_CPU, and RLIMIT_DATA for you operating system.
 
        ; big inboxes which require lots of memory to clone:
        [publicinbox "big1"]
-               mainrepo = /path/to/big1
+               inboxdir = /path/to/big1
                address = big1@example.com
                httpbackendmax = big
        [publicinbox "big2"]
-               mainrepo = /path/to/big2
+               inboxdir = /path/to/big2
                address = big2@example.com
                httpbackendmax = big
 
        ; tiny inboxes which are easily cloned:
        [publicinbox "tiny1"]
-               mainrepo = /path/to/tiny1
+               inboxdir = /path/to/tiny1
                address = tiny1@example.com
        [publicinbox "tiny2"]
-               mainrepo = /path/to/tiny2
+               inboxdir = /path/to/tiny2
                address = tiny2@example.com
 
        [publicinboxlimiter "big"]
index 4e358c9d8f689436ecba98f241b3a397516cf2ef..4c790dee689e21b6587148f2044d333a8d1bf1b9 100644 (file)
@@ -10,7 +10,7 @@ public-inbox-convert - convert v1 inboxes to v2
 
 public-inbox-convert copies the contents of an old "v1" inbox
 into a new "v2" inbox.  It makes no changes to the old inbox
-and users are expected to update the "mainrepo" path in
+and users are expected to update the "inboxdir" path in
 L<public-inbox-config(5)> to point to the path of NEW_DIR
 once they are satisfied with the conversion.
 
index 377fb2a299d4809f2a42d35eaf56c3eab529c287..f5de6bf966d0f7a03fd4cbe731a62d71e7a9bba1 100644 (file)
@@ -11,7 +11,7 @@ B<public-inbox-init> [OPTIONS] NAME INBOX_DIR HTTP_URL ADDRESS [ADDRESS..]
 Creates an empty public-inbox or reinitializes an existing one.
 It updates C<~/.public-inbox/config> by creating a
 C<[publicinbox "NAME"]> section where
-C<publicinbox.NAME.mainrepo> is C<INBOX_DIR>,
+C<publicinbox.NAME.inboxdir> is C<INBOX_DIR>,
 C<publicinbox.NAME.url> is C<HTTP_URL>, and
 C<publicinbox.NAME.address> is C<ADDRESS>.  Multiple addresses
 may be specified for inboxes with multiple addresses.
index 198c170a6951c94d5bf18e24109a13818d3dd9c7..0934eaded070d1f7dfe32abcd771508b4957c145 100644 (file)
@@ -12,7 +12,7 @@ In ~/.public-inbox/config:
                ; generic public-inbox-config keys:
                address = test@example.com
                url = http://example.com/test
-               mainrepo = /path/to/test.example.com.git
+               inboxdir = /path/to/test.example.com.git
 
                ; config keys specific to public-inbox-watch:
 
@@ -28,7 +28,7 @@ In ~/.public-inbox/config:
 
                ; optional, emails marked as read which appear
                ; here will be trained as spam and deleted from
-               ; the mainrepos of any public-inboxes which are
+               ; the inboxdirs of any public-inboxes which are
                ; configured for watch.
                ; This is global for all publicinbox.* sections
                watchspam = maildir:/path/to/maildirs/.INBOX.spam
index 7fcbe0ba52cecd1518f6949841a0079109ec12ba..ba06eec3ed52584313a2553b4db5e37a2e222ec3 100644 (file)
@@ -4,9 +4,11 @@
        address = try@public-inbox.org
        address = sandbox@public-inbox.org
        address = test@public-inbox.org
-       mainrepo = /home/pi/test-main.git
+       ; note: "mainrepo" is the old name for "inboxdir", both
+       ; remain supported for backwards compatibility.
+       inboxdir = /home/pi/test-main.git
        url = http://example.com/test
 [publicinbox "meta"]
        address = meta@public-inbox.org
-       mainrepo = /home/pi/meta-main.git
+       inboxdir = /home/pi/meta-main.git
        url = http://example.com/meta
index 2b25cf0112d9bc99fab402c989e581e4d17203c0..e9fb5d6f1d53b42043ff6393d014b446aa16e250 100644 (file)
@@ -61,7 +61,7 @@ sub detect_indexlevel ($) {
                        $l = $m;
                } elsif ($m ne '') {
                        warn <<"";
-$ibx->{mainrepo} has unexpected indexlevel in Xapian: $m
+$ibx->{inboxdir} has unexpected indexlevel in Xapian: $m
 
                }
        }
@@ -74,7 +74,7 @@ sub unconfigured_ibx ($$) {
        PublicInbox::Inbox->new({
                name => $name,
                address => [ "$name\@example.com" ],
-               mainrepo => $dir,
+               inboxdir => $dir,
                # TODO: consumers may want to warn on this:
                #-unconfigured => 1,
        });
@@ -101,12 +101,12 @@ sub resolve_inboxes ($;$) {
                $cfg->each_inbox(sub {
                        my ($ibx) = @_;
                        $ibx->{version} ||= 1;
-                       my $path = abs_path($ibx->{mainrepo});
+                       my $path = abs_path($ibx->{inboxdir});
                        if (defined($path)) {
                                $dir2ibx{$path} = $ibx;
                        } else {
                                warn <<EOF;
-W: $ibx->{name} $ibx->{mainrepo}: $!
+W: $ibx->{name} $ibx->{inboxdir}: $!
 EOF
                        }
                });
index 2e2a8629da2806f09df171422afc7c012fad4246..d4a92266d95a5d01f3fa6b4c90ddc0c26a86c7f0 100644 (file)
@@ -25,7 +25,7 @@ sub check_editable ($) {
                # it's possible for a Xapian directory to exist,
                # but Search::Xapian to go missing/broken.
                # Make sure it's purged in that case:
-               $ibx->over or die "no over.sqlite3 in $ibx->{mainrepo}\n";
+               $ibx->over or die "no over.sqlite3 in $ibx->{inboxdir}\n";
 
                # $ibx->{search} is populated by $ibx->over call
                my $xdir_ro = $ibx->{search}->xdir(1);
@@ -51,7 +51,7 @@ sub check_editable ($) {
 # $rewrites = [ array commits keyed by epoch ]
 sub show_rewrites ($$$) {
        my ($fh, $ibx, $rewrites) = @_;
-       print $fh "$ibx->{mainrepo}:";
+       print $fh "$ibx->{inboxdir}:";
        if (scalar @$rewrites) {
                my $epoch = -1;
                my @out = map {;
index 6103d52e7fba0a4768a0bad20e2d7071bec5b53e..b4daaed2b64c56355ba539bebd60f1e173c7c350 100644 (file)
@@ -32,9 +32,9 @@ sub new {
        my $f = $params{file} or die "file: required for $type spec $spec\n";
        unless (index($f, '/') == 0) {
                if (($ibx->{version} || 1) == 1) {
-                       $f = "$ibx->{mainrepo}/public-inbox/$f";
+                       $f = "$ibx->{inboxdir}/public-inbox/$f";
                } else {
-                       $f = "$ibx->{mainrepo}/$f";
+                       $f = "$ibx->{inboxdir}/$f";
                }
        }
        bless {
index 509de0a0b844784f6d8c05bbc5d1ac741dd4902b..2da202f99f6dd2e45729cb1a8dcca702d572c726 100644 (file)
@@ -93,7 +93,7 @@ sub each_inbox {
        # may auto-vivify if config file is non-existent:
        foreach my $section (@{$self->{-section_order}}) {
                next if $section !~ m!\Apublicinbox\.([^/]+)\z!;
-               defined($self->{"publicinbox.$1.mainrepo"}) or next;
+               defined($self->{"publicinbox.$1.inboxdir"}) or next;
                my $ibx = lookup_name($self, $1) or next;
                $cb->($ibx);
        }
@@ -362,12 +362,16 @@ sub _fill {
        my ($self, $pfx) = @_;
        my $ibx = {};
 
-       foreach my $k (qw(mainrepo filter url newsgroup
+       foreach my $k (qw(inboxdir filter url newsgroup
                        infourl watch watchheader httpbackendmax
                        replyto feedmax nntpserver indexlevel)) {
                my $v = $self->{"$pfx.$k"};
                $ibx->{$k} = $v if defined $v;
        }
+
+       # backwards compatibility:
+       $ibx->{inboxdir} //= $self->{"$pfx.mainrepo"};
+
        foreach my $k (qw(obfuscate)) {
                my $v = $self->{"$pfx.$k"};
                defined $v or next;
@@ -385,7 +389,7 @@ sub _fill {
                }
        }
 
-       return unless $ibx->{mainrepo};
+       return unless $ibx->{inboxdir};
        my $name = $pfx;
        $name =~ s/\Apublicinbox\.//;
 
index 85f56acbae18e30eed54a52e342cb4a4885fa355..5feb2154f562fda7ce69271d11f3f40e9ba44b88 100644 (file)
@@ -109,7 +109,7 @@ sub new {
        _set_limiter($opts, $pi_config, 'httpbackend');
        _set_uint($opts, 'feedmax', 25);
        $opts->{nntpserver} ||= $pi_config->{'publicinbox.nntpserver'};
-       my $dir = $opts->{mainrepo};
+       my $dir = $opts->{inboxdir};
        if (defined $dir && -f "$dir/inbox.lock") {
                $opts->{version} = 2;
        }
@@ -129,7 +129,7 @@ sub git_epoch {
        my ($self, $epoch) = @_;
        ($self->{version} || 1) == 2 or return;
        $self->{"$epoch.git"} ||= eval {
-               my $git_dir = "$self->{mainrepo}/git/$epoch.git";
+               my $git_dir = "$self->{inboxdir}/git/$epoch.git";
                my $g = PublicInbox::Git->new($git_dir);
                $g->{-httpbackend_limiter} = $self->{-httpbackend_limiter};
                # no cleanup needed, we never cat-file off this, only clone
@@ -140,7 +140,7 @@ sub git_epoch {
 sub git {
        my ($self) = @_;
        $self->{git} ||= eval {
-               my $git_dir = $self->{mainrepo};
+               my $git_dir = $self->{inboxdir};
                $git_dir .= '/all.git' if (($self->{version} || 1) == 2);
                my $g = PublicInbox::Git->new($git_dir);
                $g->{-httpbackend_limiter} = $self->{-httpbackend_limiter};
@@ -157,7 +157,7 @@ sub max_git_epoch {
        my $changed = git($self)->alternates_changed;
        if (!defined($cur) || $changed) {
                $self->git->cleanup if $changed;
-               my $gits = "$self->{mainrepo}/git";
+               my $gits = "$self->{inboxdir}/git";
                if (opendir my $dh, $gits) {
                        my $max = -1;
                        while (defined(my $git_dir = readdir($dh))) {
@@ -177,7 +177,7 @@ sub mm {
        $self->{mm} ||= eval {
                require PublicInbox::Msgmap;
                _cleanup_later($self);
-               my $dir = $self->{mainrepo};
+               my $dir = $self->{inboxdir};
                if (($self->{version} || 1) >= 2) {
                        PublicInbox::Msgmap->new_file("$dir/msgmap.sqlite3");
                } else {
@@ -220,7 +220,7 @@ sub description {
        my ($self) = @_;
        my $desc = $self->{description};
        return $desc if defined $desc;
-       $desc = try_cat("$self->{mainrepo}/description");
+       $desc = try_cat("$self->{inboxdir}/description");
        local $/ = "\n";
        chomp $desc;
        $desc =~ s/\s+/ /smg;
@@ -232,7 +232,7 @@ sub cloneurl {
        my ($self) = @_;
        my $url = $self->{cloneurl};
        return $url if $url;
-       $url = try_cat("$self->{mainrepo}/cloneurl");
+       $url = try_cat("$self->{inboxdir}/cloneurl");
        my @url = split(/\s+/s, $url);
        local $/ = "\n";
        chomp @url;
index 4b22149f48c8f72bf0d0b562ff8ecdd9491c63d2..174e4245ab08157714b05f6e19377018023a1fc9 100644 (file)
@@ -35,7 +35,7 @@ sub init_inbox {
        # TODO: honor skip_artnum
        my $v = $self->{version} || 1;
        if ($v == 1) {
-               my $dir = $self->{mainrepo} or die "no mainrepo in inbox\n";
+               my $dir = $self->{inboxdir} or die "no inboxdir in inbox\n";
                PublicInbox::Import::init_bare($dir);
        } else {
                my $v2w = importer($self);
index a0e6a93b1e4460d08aff18ff2a48a881a5fcd25a..06a84c340e4cd8a5502018801f5b689b6149d70c 100644 (file)
@@ -126,9 +126,9 @@ chomp @HELP;
 sub xdir ($;$) {
        my ($self, $rdonly) = @_;
        if ($self->{version} == 1) {
-               "$self->{mainrepo}/public-inbox/xapian" . SCHEMA_VERSION;
+               "$self->{inboxdir}/public-inbox/xapian" . SCHEMA_VERSION;
        } else {
-               my $dir = "$self->{mainrepo}/xap" . SCHEMA_VERSION;
+               my $dir = "$self->{inboxdir}/xap" . SCHEMA_VERSION;
                return $dir if $rdonly;
 
                my $shard = $self->{shard};
@@ -173,7 +173,7 @@ sub new {
        my ($class, $ibx) = @_;
        ref $ibx or die "BUG: expected PublicInbox::Inbox object: $ibx";
        my $self = bless {
-               mainrepo => $ibx->{mainrepo},
+               inboxdir => $ibx->{inboxdir},
                altid => $ibx->{altid},
                version => $ibx->{version} // 1,
        }, $class;
index 1b1a21b767b1443367045a845a6c8a3acb37ef22..aed3875a037254b94222faa2147e9f17abe31612 100644 (file)
@@ -32,7 +32,7 @@ sub new {
        my ($class, $ibx, $creat, $shard) = @_;
        ref $ibx or die "BUG: expected PublicInbox::Inbox object: $ibx";
        my $levels = qr/\A(?:full|medium|basic)\z/;
-       my $mainrepo = $ibx->{mainrepo};
+       my $inboxdir = $ibx->{inboxdir};
        my $version = $ibx->{version} || 1;
        my $indexlevel = 'full';
        my $altid = $ibx->{altid};
@@ -49,7 +49,7 @@ sub new {
        }
        $ibx = PublicInbox::InboxWritable->new($ibx);
        my $self = bless {
-               mainrepo => $mainrepo,
+               inboxdir => $inboxdir,
                -inbox => $ibx,
                git => $ibx->git,
                -altid => $altid,
@@ -58,7 +58,7 @@ sub new {
        }, $class;
        $ibx->umask_prepare;
        if ($version == 1) {
-               $self->{lock_path} = "$mainrepo/ssoma.lock";
+               $self->{lock_path} = "$inboxdir/ssoma.lock";
                my $dir = $self->xdir;
                $self->{over} = PublicInbox::OverIdx->new("$dir/over.sqlite3");
        } elsif ($version == 2) {
@@ -603,7 +603,7 @@ sub _msgmap_init {
        die "BUG: _msgmap_init is only for v1\n" if $self->{version} != 1;
        $self->{mm} ||= eval {
                require PublicInbox::Msgmap;
-               PublicInbox::Msgmap->new($self->{mainrepo}, 1);
+               PublicInbox::Msgmap->new($self->{inboxdir}, 1);
        };
 }
 
index 627bcba94a0c4ec57239b8e98aa9318bb76ea18c..6a88f62aea1ab3042aef1875a23bd45d3dd643a0 100644 (file)
@@ -76,7 +76,7 @@ sub new {
        # $creat may be any true value, or 0/undef.  A hashref is true,
        # and $creat->{nproc} may be set to an integer
        my ($class, $v2ibx, $creat) = @_;
-       my $dir = $v2ibx->{mainrepo} or die "no mainrepo in inbox\n";
+       my $dir = $v2ibx->{inboxdir} or die "no inboxdir in inbox\n";
        unless (-d $dir) {
                if ($creat) {
                        require File::Path;
@@ -304,7 +304,7 @@ sub idx_init {
                # Now that all subprocesses are up, we can open the FDs
                # for SQLite:
                my $mm = $self->{mm} = PublicInbox::Msgmap->new_file(
-                       "$self->{-inbox}->{mainrepo}/msgmap.sqlite3", 1);
+                       "$self->{-inbox}->{inboxdir}/msgmap.sqlite3", 1);
                $mm->{dbh}->begin_work;
        });
 }
@@ -315,7 +315,7 @@ sub idx_init {
 sub _replace_oids ($$$) {
        my ($self, $mime, $replace_map) = @_;
        $self->done;
-       my $pfx = "$self->{-inbox}->{mainrepo}/git";
+       my $pfx = "$self->{-inbox}->{inboxdir}/git";
        my $rewrites = []; # epoch => commit
        my $max = $self->{epoch_max};
 
@@ -663,8 +663,8 @@ sub done {
 sub fill_alternates ($$) {
        my ($self, $epoch) = @_;
 
-       my $pfx = "$self->{-inbox}->{mainrepo}/git";
-       my $all = "$self->{-inbox}->{mainrepo}/all.git";
+       my $pfx = "$self->{-inbox}->{inboxdir}/git";
+       my $all = "$self->{-inbox}->{inboxdir}/all.git";
 
        unless (-d $all) {
                PublicInbox::Import::init_bare($all);
@@ -690,7 +690,7 @@ sub fill_alternates ($$) {
 
 sub git_init {
        my ($self, $epoch) = @_;
-       my $git_dir = "$self->{-inbox}->{mainrepo}/git/$epoch.git";
+       my $git_dir = "$self->{-inbox}->{inboxdir}/git/$epoch.git";
        my @cmd = (qw(git init --bare -q), $git_dir);
        PublicInbox::Import::run_die(\@cmd);
        @cmd = (qw/git config/, "--file=$git_dir/config",
@@ -703,7 +703,7 @@ sub git_init {
 sub git_dir_latest {
        my ($self, $max) = @_;
        $$max = -1;
-       my $pfx = "$self->{-inbox}->{mainrepo}/git";
+       my $pfx = "$self->{-inbox}->{inboxdir}/git";
        return unless -d $pfx;
        my $latest;
        opendir my $dh, $pfx or die "opendir $pfx: $!\n";
@@ -935,7 +935,7 @@ sub update_last_commit ($$$$) {
        last_epoch_commit($self, $i, $cmt);
 }
 
-sub git_dir_n ($$) { "$_[0]->{-inbox}->{mainrepo}/git/$_[1].git" }
+sub git_dir_n ($$) { "$_[0]->{-inbox}->{inboxdir}/git/$_[1].git" }
 
 sub last_commits ($$) {
        my ($self, $epoch_max) = @_;
index 05659f1fad7e2355cdd3052f1e597daebee54449..83984d37e1813525f621a72afe9a09dc67079706 100644 (file)
@@ -84,7 +84,7 @@ sub atom_header {
                $self_url .= 'new.atom';
                $page_id = "mailto:$ibx->{-primary_address}";
        }
-       my $mtime = (stat($ibx->{mainrepo}))[9] || time;
+       my $mtime = (stat($ibx->{inboxdir}))[9] || time;
 
        qq(<?xml version="1.0" encoding="us-ascii"?>\n) .
        qq(<feed\nxmlns="http://www.w3.org/2005/Atom"\n) .
index 1d4029f047ed35a738ed7c75854d374f23ba93c2..c5e16eb2ea9d6ee150df207b2d06c57130a7878a 100644 (file)
@@ -141,7 +141,7 @@ sub fingerprint ($) {
 sub manifest_add ($$;$$) {
        my ($manifest, $ibx, $epoch, $default_desc) = @_;
        my $url_path = "/$ibx->{name}";
-       my $git_dir = $ibx->{mainrepo};
+       my $git_dir = $ibx->{inboxdir};
        if (defined $epoch) {
                $git_dir .= "/git/$epoch.git";
                $url_path .= "/git/$epoch.git";
index f5338c39a67486d3569993d182b639c5ec6516bb..6696cc35d4d1e24e402ab6ad49f03275a0761333 100644 (file)
@@ -98,7 +98,7 @@ sub _html_end {
                $seen{$http} = 1;
                for my $i (0..$max) {
                        # old parts my be deleted:
-                       -d "$ibx->{mainrepo}/git/$i.git" or next;
+                       -d "$ibx->{inboxdir}/git/$i.git" or next;
                        my $url = "$http/$i";
                        $seen{$url} = 1;
                        push @urls, "$url $dir/git/$i.git";
index bcda665c75b9572c029b86b9a829db09e27834fa..1c7b92bd466e5a1a5aeeeee97fc950a413a3184c 100644 (file)
@@ -145,6 +145,9 @@ sub inbox_config ($$$) {
 ; see public-inbox-config(5) manpage for more details:
 ; https://public-inbox.org/public-inbox-config.html
 [publicinbox "$name"]
+       inboxdir = /path/to/top-level-inbox
+       ; note: public-inbox before v1.2.0 used "mainrepo"
+       ; instead of "inboxdir", both remain supported after 1.2
        mainrepo = /path/to/top-level-inbox
 EOS
        for my $k (qw(address listid)) {
index 819d7829d37dbd95398fcaebb2163365f29d74a2..22e56f42263bf2e85b4a857cfd7b8c4a8381228c 100644 (file)
@@ -153,7 +153,7 @@ sub run {
        my ($ibx, $task, $opt) = @_; # task = 'cpdb' or 'compact'
        my $cb = \&${\"PublicInbox::Xapcmd::$task"};
        PublicInbox::Admin::progress_prepare($opt ||= {});
-       my $dir = $ibx->{mainrepo} or die "no mainrepo in inbox\n";
+       my $dir = $ibx->{inboxdir} or die "no inboxdir in inbox\n";
        runnable_or_die($XAPIAN_COMPACT) if $opt->{compact};
        my $reindex; # v1:{ from => $x40 }, v2:{ from => [ $x40, $x40, .. ] } }
        my $from; # per-epoch ranges
@@ -181,7 +181,7 @@ sub run {
        if ($v == 1) {
                if (defined $reshard) {
                        warn
-"--reshard=$reshard ignored for v1 $ibx->{mainrepo}\n";
+"--reshard=$reshard ignored for v1 $ibx->{inboxdir}\n";
                }
                my $old_parent = dirname($old);
                same_fs_or_die($old_parent, $old);
index 9d2d2512a403f99f2d994429d43f166796575e9e..3182410e0a6f0e5037bc41b3b0a8bd040389f072 100755 (executable)
@@ -30,14 +30,14 @@ $old_dir = abs_path($old_dir);
 my $old;
 if ($config) {
        $config->each_inbox(sub {
-               $old = $_[0] if abs_path($_[0]->{mainrepo}) eq $old_dir;
+               $old = $_[0] if abs_path($_[0]->{inboxdir}) eq $old_dir;
        });
 }
 unless ($old) {
        warn "W: $old_dir not configured in " .
                PublicInbox::Config::default_file() . "\n";
        $old = {
-               mainrepo => $old_dir,
+               inboxdir => $old_dir,
                name => 'ignored',
                address => [ 'old@example.com' ],
        };
@@ -48,7 +48,7 @@ if (($old->{version} || 1) >= 2) {
        die "Only conversion from v1 inboxes is supported\n";
 }
 my $new = { %$old };
-$new->{mainrepo} = abs_path($new_dir);
+$new->{inboxdir} = abs_path($new_dir);
 $new->{version} = 2;
 $new = PublicInbox::InboxWritable->new($new);
 my $v2w;
@@ -62,9 +62,9 @@ sub link_or_copy ($$) {
 }
 
 $old->with_umask(sub {
-       my $old_cfg = "$old->{mainrepo}/config";
+       my $old_cfg = "$old->{inboxdir}/config";
        local $ENV{GIT_CONFIG} = $old_cfg;
-       my $new_cfg = "$new->{mainrepo}/all.git/config";
+       my $new_cfg = "$new->{inboxdir}/all.git/config";
        $v2w = PublicInbox::V2Writable->new($new, 1);
        $v2w->init_inbox($jobs);
        unlink $new_cfg;
@@ -79,9 +79,9 @@ $old->with_umask(sub {
                        $src->mm_alt->{dbh}->sqlite_backup_to_file($dst);
                }
        }
-       my $desc = "$old->{mainrepo}/description";
-       link_or_copy($desc, "$new->{mainrepo}/description") if -e $desc;
-       my $clone = "$old->{mainrepo}/cloneurl";
+       my $desc = "$old->{inboxdir}/description";
+       link_or_copy($desc, "$new->{inboxdir}/description") if -e $desc;
+       my $clone = "$old->{inboxdir}/cloneurl";
        if (-e $clone) {
                warn <<"";
 $clone may not be valid after migrating to v2, not copying
index 6884fd0cb276623f64f4e27b7cb5e965c4140256..f2090abfe583992ab6c398213438c3a76a3775d3 100755 (executable)
@@ -65,7 +65,7 @@ sub find_mid ($) {
 
 sub show_cmd ($$) {
        my ($ibx, $smsg) = @_;
-       " GIT_DIR=$ibx->{mainrepo}/all.git \\\n    git show $smsg->{blob}\n";
+       " GIT_DIR=$ibx->{inboxdir}/all.git \\\n    git show $smsg->{blob}\n";
 }
 
 sub show_found () {
index 8fd2f9dc2f5c490cb8325dbd8b6b74b91febd5be..507112661ddc6a61619b7e30cfc2bbbca59cec71 100755 (executable)
@@ -31,7 +31,7 @@ my %opts = (
 GetOptions(%opts) or usage();
 PublicInbox::Admin::indexlevel_ok_or_die($indexlevel) if defined $indexlevel;
 my $name = shift @ARGV or usage();
-my $mainrepo = shift @ARGV or usage();
+my $inboxdir = shift @ARGV or usage();
 my $http_url = shift @ARGV or usage();
 my (@address) = @ARGV;
 @address or usage();
@@ -112,18 +112,18 @@ close $fh or die "failed to close $pi_config_tmp: $!\n";
 my $pfx = "publicinbox.$name";
 my @x = (qw/git config/, "--file=$pi_config_tmp");
 
-$mainrepo = abs_path($mainrepo);
-if (-f "$mainrepo/inbox.lock") {
+$inboxdir = abs_path($inboxdir);
+if (-f "$inboxdir/inbox.lock") {
        if (!defined $version) {
                $version = 2;
        } elsif ($version != 2) {
-               die "$mainrepo is a -V2 repo, -V$version specified\n"
+               die "$inboxdir is a -V2 repo, -V$version specified\n"
        }
-} elsif (-d "$mainrepo/objects") {
+} elsif (-d "$inboxdir/objects") {
        if (!defined $version) {
                $version = 1;
        } elsif ($version != 1) {
-               die "$mainrepo is a -V1 repo, -V$version specified\n"
+               die "$inboxdir is a -V1 repo, -V$version specified\n"
        }
 }
 
@@ -134,7 +134,7 @@ if ($version == 1 && defined $skip_epoch) {
 }
 
 my $ibx = PublicInbox::Inbox->new({
-       mainrepo => $mainrepo,
+       inboxdir => $inboxdir,
        name => $name,
        version => $version,
        -primary_address => $address[0],
@@ -152,7 +152,7 @@ foreach my $addr (@address) {
        x(@x, "--add", "$pfx.address", $addr);
 }
 x(@x, "$pfx.url", $http_url);
-x(@x, "$pfx.mainrepo", $mainrepo);
+x(@x, "$pfx.inboxdir", $inboxdir);
 
 if (defined($indexlevel)) {
        x(@x, "$pfx.indexlevel", $indexlevel);
index 2655a6c5ed064aad67b97f0c575a3212cde68344..dea49dc547820616ad88a53d0bd2e39b91ab34f1 100755 (executable)
@@ -51,7 +51,7 @@ if (!defined $dst) {
        }
        defined $dst or do_exit(67); # EX_NOUSER 5.1.1 user unknown
 }
-$dst->{mainrepo} or do_exit(67);
+$dst->{inboxdir} or do_exit(67);
 $dst = PublicInbox::InboxWritable->new($dst);
 
 # pre-check, MDA has stricter rules than an importer might;
index 1e98093685a5d946b7ca5fd7322b5b2a4604845d..8060a9d7e7f10de3ee7a76b65a76f59713718a25 100644 (file)
@@ -14,7 +14,7 @@ my $ibx;
 if (index($repo, '@') > 0) {
        $ibx = PublicInbox::Config->new->lookup($repo);
 } elsif (-d $repo) {
-       $ibx = { mainrepo => $repo, address => 'unnamed@example.com' };
+       $ibx = { inboxdir => $repo, address => 'unnamed@example.com' };
        $ibx = PublicInbox::Inbox->new($ibx);
 } else {
        $ibx = PublicInbox::Config->new->lookup_name($repo);
index b2dd5b3ab471c8da2d81dc5e7c2ff8144ba7c70e..6329dd16090095e379f24676da6868849e4b0960 100644 (file)
@@ -23,9 +23,9 @@ if ($variant ne 'mboxrd' && $variant ne 'mboxo') {
 }
 my $name = shift or die $usage; # git
 my $email = shift or die $usage; # git@vger.kernel.org
-my $mainrepo = shift or die $usage; # /path/to/v2/repo
+my $inboxdir = shift or die $usage; # /path/to/v2/repo
 my $ibx = {
-       mainrepo => $mainrepo,
+       inboxdir => $inboxdir,
        name => $name,
        version => $version,
        address => [ $email ],
@@ -37,7 +37,7 @@ unless ($dry_run) {
                require PublicInbox::V2Writable;
                PublicInbox::V2Writable->new($ibx, 1)->init_inbox(0);
        } else {
-               system(qw(git init --bare -q), $mainrepo) == 0 or die;
+               system(qw(git init --bare -q), $inboxdir) == 0 or die;
        }
 }
 $ibx = PublicInbox::InboxWritable->new($ibx);
index 3790c9e2e20a2248e22c259e63b027bc346244e6..0024df1516c2fd0ad8401abd5dc7c7c41e503634 100644 (file)
--- a/t/admin.t
+++ b/t/admin.t
@@ -56,7 +56,7 @@ SKIP: {
        use_ok 'PublicInbox::V2Writable';
        use_ok 'PublicInbox::Inbox';
        my $ibx = PublicInbox::Inbox->new({
-                       mainrepo => $v2_dir,
+                       inboxdir => $v2_dir,
                        name => 'test-v2writable',
                        version => 2,
                        -primary_address => 'test@example.com',
index b8d32f781773f018b11aad77e640ef0973fc66ae..4ab004c4d8e8fc2ec8e30b49c50a8cf77619e8d3 100644 (file)
--- a/t/altid.t
+++ b/t/altid.t
@@ -43,7 +43,7 @@ my $ibx;
        $im->done;
 }
 {
-       $ibx = PublicInbox::Inbox->new({mainrepo => $git_dir});
+       $ibx = PublicInbox::Inbox->new({inboxdir => $git_dir});
        $ibx->{altid} = $altid;
        my $rw = PublicInbox::SearchIdx->new($ibx, 1);
        $rw->index_sync;
index 35ab7a1b25080263987b3d871ef453c7f9577ee7..2c1d8616cae3d051085d78316640abb94785c30c 100644 (file)
@@ -14,12 +14,12 @@ foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
 use_ok 'PublicInbox::V2Writable';
 use_ok 'PublicInbox::Inbox';
 my $tmpdir = tempdir('pi-altidv2-XXXXXX', TMPDIR => 1, CLEANUP => 1);
-my $mainrepo = "$tmpdir/inbox";
+my $inboxdir = "$tmpdir/inbox";
 my $full = "$tmpdir/inbox/another-nntp.sqlite3";
 my $altid = [ 'serial:gmane:file=another-nntp.sqlite3' ];
 
 {
-       ok(mkdir($mainrepo), 'created repo for msgmap');
+       ok(mkdir($inboxdir), 'created repo for msgmap');
        my $mm = PublicInbox::Msgmap->new_file($full, 1);
        is($mm->mid_set(1234, 'a@example.com'), 1, 'mid_set once OK');
        ok(0 == $mm->mid_set(1234, 'a@example.com'), 'mid_set not idempotent');
@@ -27,7 +27,7 @@ my $altid = [ 'serial:gmane:file=another-nntp.sqlite3' ];
 }
 
 my $ibx = {
-       mainrepo => $mainrepo,
+       inboxdir => $inboxdir,
        name => 'test-v2writable',
        version => 2,
        -primary_address => 'test@example.com',
diff --git a/t/cgi.t b/t/cgi.t
index 51d649142cabda7aecb2ed453b76d546e475753c..1b4b06cb5eb47bb205ae128c9b53ee3e6e167307 100644 (file)
--- a/t/cgi.t
+++ b/t/cgi.t
@@ -29,7 +29,7 @@ my $cfgpfx = "publicinbox.test";
        close $fh or die "close: $!\n";
        my %cfg = (
                "$cfgpfx.address" => $addr,
-               "$cfgpfx.mainrepo" => $maindir,
+               "$cfgpfx.inboxdir" => $maindir,
                "$cfgpfx.indexlevel" => 'basic',
        );
        while (my ($k,$v) = each %cfg) {
index 3b4b12b32c20715ccfa60c6a665b43da9036212a..0866f264e151bffcabda1f9d1bb9055bdc48d33f 100644 (file)
@@ -24,7 +24,7 @@ my $tmpdir = tempdir('pi-config-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 
        my $cfg = PublicInbox::Config->new($f);
        is_deeply($cfg->lookup('meta@public-inbox.org'), {
-               'mainrepo' => '/home/pi/meta-main.git',
+               'inboxdir' => '/home/pi/meta-main.git',
                'address' => [ 'meta@public-inbox.org' ],
                'domain' => 'public-inbox.org',
                'url' => 'http://example.com/meta',
@@ -44,7 +44,7 @@ my $tmpdir = tempdir('pi-config-XXXXXX', TMPDIR => 1, CLEANUP => 1);
                              'sandbox@public-inbox.org',
                              'test@public-inbox.org'],
                -primary_address => 'try@public-inbox.org',
-               'mainrepo' => '/home/pi/test-main.git',
+               'inboxdir' => '/home/pi/test-main.git',
                'domain' => 'public-inbox.org',
                'name' => 'test',
                feedmax => 25,
@@ -66,13 +66,29 @@ $cfgpfx.altid=serial:enamg:file=b
 EOF
        my $ibx = $config->lookup_name('test');
        is_deeply($ibx->{altid}, [ @altid ]);
+
+       $config = PublicInbox::Config->new(\<<EOF);
+$cfgpfx.address=test\@example.com
+$cfgpfx.mainrepo=/path/to/non/existent
+EOF
+       $ibx = $config->lookup_name('test');
+       is($ibx->{inboxdir}, '/path/to/non/existent', 'mainrepo still works');
+
+       $config = PublicInbox::Config->new(\<<EOF);
+$cfgpfx.address=test\@example.com
+$cfgpfx.inboxdir=/path/to/non/existent
+$cfgpfx.mainrepo=/path/to/deprecated
+EOF
+       $ibx = $config->lookup_name('test');
+       is($ibx->{inboxdir}, '/path/to/non/existent',
+               'inboxdir takes precedence');
 }
 
 {
        my $pfx = "publicinbox.test";
        my $str = <<EOF;
 $pfx.address=test\@example.com
-$pfx.mainrepo=/path/to/non/existent
+$pfx.inboxdir=/path/to/non/existent
 publicinbox.nntpserver=news.example.com
 EOF
        my $cfg = PublicInbox::Config->new(\$str);
@@ -81,7 +97,7 @@ EOF
 
        $str = <<EOF;
 $pfx.address=test\@example.com
-$pfx.mainrepo=/path/to/non/existent
+$pfx.inboxdir=/path/to/non/existent
 $pfx.nntpserver=news.alt.example.com
 EOF
        $cfg = PublicInbox::Config->new(\$str);
@@ -95,9 +111,9 @@ EOF
        my $pfx2 = "publicinbox.foo";
        my $str = <<EOF;
 $pfx.address=test\@example.com
-$pfx.mainrepo=/path/to/non/existent
+$pfx.inboxdir=/path/to/non/existent
 $pfx2.address=foo\@example.com
-$pfx2.mainrepo=/path/to/foo
+$pfx2.inboxdir=/path/to/foo
 publicinbox.noobfuscate=public-inbox.org \@example.com z\@EXAMPLE.com
 $pfx.obfuscate=true
 EOF
@@ -161,7 +177,7 @@ for my $s (@valid) {
                push @expect, "$i";
                print $fh <<"" or die "print: $!";
 [publicinbox "$i"]
-       mainrepo = /path/to/$i.git
+       inboxdir = /path/to/$i.git
        address = $i\@example.com
 
        }
@@ -177,9 +193,9 @@ for my $s (@valid) {
        my $pfx2 = "publicinbox.test2";
        my $str = <<EOF;
 $pfx1.address=test\@example.com
-$pfx1.mainrepo=/path/to/non/existent
+$pfx1.inboxdir=/path/to/non/existent
 $pfx2.address=foo\@example.com
-$pfx2.mainrepo=/path/to/foo
+$pfx2.inboxdir=/path/to/foo
 $pfx1.coderepo=project
 $pfx2.coderepo=project
 coderepo.project.dir=/path/to/project.git
index c1fffecf8b3c381ae91ee8a60769ff3b6fddadf2..57e298bab80ef4e0613f93c4d09be5dcd099016e 100644 (file)
@@ -8,7 +8,7 @@ my $cfgpfx = "publicinbox.test";
 {
        my $config = PublicInbox::Config->new(\<<EOF);
 $cfgpfx.address=test\@example.com
-$cfgpfx.mainrepo=/path/to/non/existent
+$cfgpfx.inboxdir=/path/to/non/existent
 $cfgpfx.httpbackendmax=12
 EOF
        my $ibx = $config->lookup_name('test');
@@ -27,7 +27,7 @@ EOF
        my $config = PublicInbox::Config->new(\<<EOF);
 publicinboxlimiter.named.max=3
 $cfgpfx.address=test\@example.com
-$cfgpfx.mainrepo=/path/to/non/existent
+$cfgpfx.inboxdir=/path/to/non/existent
 $cfgpfx.httpbackendmax=named
 EOF
        my $ibx = $config->lookup_name('test');
index 6d09103176c69cb31ad95f6f1f65e3e5e933fe2e..dbccfbadf59b45bca05d82c7b9b848c2a802bc9f 100644 (file)
@@ -20,15 +20,15 @@ use_ok 'PublicInbox::V2Writable';
 use PublicInbox::Import;
 my $tmpdir = tempdir('convert-compact-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $ibx = {
-       mainrepo => "$tmpdir/v1",
+       inboxdir => "$tmpdir/v1",
        name => 'test-v1',
        -primary_address => 'test@example.com',
 };
 
-ok(PublicInbox::Import::run_die([qw(git init --bare -q), $ibx->{mainrepo}]),
+ok(PublicInbox::Import::run_die([qw(git init --bare -q), $ibx->{inboxdir}]),
        'initialized v1 repo');
 ok(umask(077), 'set restrictive umask');
-ok(PublicInbox::Import::run_die([qw(git) , "--git-dir=$ibx->{mainrepo}",
+ok(PublicInbox::Import::run_die([qw(git) , "--git-dir=$ibx->{inboxdir}",
        qw(config core.sharedRepository 0644)]), 'set sharedRepository');
 $ibx = PublicInbox::Inbox->new($ibx);
 my $im = PublicInbox::Import->new($ibx->git, undef, undef, $ibx);
@@ -51,11 +51,11 @@ for (1..2) {
        is($@, '', 'no errors syncing');
 }
 
-is(((stat("$ibx->{mainrepo}/public-inbox"))[2]) & 07777, 0755,
+is(((stat("$ibx->{inboxdir}/public-inbox"))[2]) & 07777, 0755,
        'sharedRepository respected for v1');
-is(((stat("$ibx->{mainrepo}/public-inbox/msgmap.sqlite3"))[2]) & 07777, 0644,
+is(((stat("$ibx->{inboxdir}/public-inbox/msgmap.sqlite3"))[2]) & 07777, 0644,
        'sharedRepository respected for v1 msgmap');
-my @xdir = glob("$ibx->{mainrepo}/public-inbox/xap*/*");
+my @xdir = glob("$ibx->{inboxdir}/public-inbox/xap*/*");
 foreach (@xdir) {
        my @st = stat($_);
        is($st[2] & 07777, -f _ ? 0644 : 0755,
@@ -68,15 +68,15 @@ open my $err, '>>', "$tmpdir/err.log" or die "open: err.log $!\n";
 open my $out, '>>', "$tmpdir/out.log" or die "open: out.log $!\n";
 my $rdr = { 1 => fileno($out), 2 => fileno($err) };
 
-my $cmd = [ 'public-inbox-compact', $ibx->{mainrepo} ];
+my $cmd = [ 'public-inbox-compact', $ibx->{inboxdir} ];
 ok(PublicInbox::Import::run_die($cmd, undef, $rdr), 'v1 compact works');
 
-@xdir = glob("$ibx->{mainrepo}/public-inbox/xap*");
+@xdir = glob("$ibx->{inboxdir}/public-inbox/xap*");
 is(scalar(@xdir), 1, 'got one xapian directory after compact');
 is(((stat($xdir[0]))[2]) & 07777, 0755,
        'sharedRepository respected on v1 compact');
 
-$cmd = [ 'public-inbox-convert', $ibx->{mainrepo}, "$tmpdir/v2" ];
+$cmd = [ 'public-inbox-convert', $ibx->{inboxdir}, "$tmpdir/v2" ];
 ok(PublicInbox::Import::run_die($cmd, undef, $rdr), 'convert works');
 @xdir = glob("$tmpdir/v2/xap*/*");
 foreach (@xdir) {
@@ -88,7 +88,7 @@ foreach (@xdir) {
 $cmd = [ 'public-inbox-compact', "$tmpdir/v2" ];
 my $env = { NPROC => 2 };
 ok(PublicInbox::Import::run_die($cmd, $env, $rdr), 'v2 compact works');
-$ibx->{mainrepo} = "$tmpdir/v2";
+$ibx->{inboxdir} = "$tmpdir/v2";
 $ibx->{version} = 2;
 
 @xdir = glob("$tmpdir/v2/xap*/*");
index 6b4e35c3a7751a9575a38f1aa3dacd6fd77cb07b..1e9597f1f98b8ae6d46785c04b3c1a30f2768579 100644 (file)
--- a/t/edit.t
+++ b/t/edit.t
@@ -21,9 +21,9 @@ IPC::Run->import(qw(run));
 
 my $cmd_pfx = 'blib/script/public-inbox';
 my $tmpdir = tempdir('pi-edit-XXXXXX', TMPDIR => 1, CLEANUP => 1);
-my $mainrepo = "$tmpdir/v2";
+my $inboxdir = "$tmpdir/v2";
 my $ibx = PublicInbox::Inbox->new({
-       mainrepo => $mainrepo,
+       inboxdir => $inboxdir,
        name => 'test-v2edit',
        version => 2,
        -primary_address => 'test@example.com',
@@ -41,12 +41,12 @@ my $mid = mid_clean($mime->header('Message-Id'));
 ok($im->add($mime), 'add message to be edited');
 $im->done;
 my ($in, $out, $err, $cmd, $cur, $t);
-my $__git_dir = "--git-dir=$ibx->{mainrepo}/git/0.git";
+my $__git_dir = "--git-dir=$ibx->{inboxdir}/git/0.git";
 
 $t = '-F FILE'; {
        $in = $out = $err = '';
        local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/boolean prefix/bool pfx/'";
-       $cmd = [ "$cmd_pfx-edit", "-F$file", $mainrepo ];
+       $cmd = [ "$cmd_pfx-edit", "-F$file", $inboxdir ];
        ok(run($cmd, \$in, \$out, \$err), "$t edit OK");
        $cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
        like($cur->header('Subject'), qr/bool pfx/, "$t message edited");
@@ -56,7 +56,7 @@ $t = '-F FILE'; {
 $t = '-m MESSAGE_ID'; {
        $in = $out = $err = '';
        local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/bool pfx/boolean prefix/'";
-       $cmd = [ "$cmd_pfx-edit", "-m$mid", $mainrepo ];
+       $cmd = [ "$cmd_pfx-edit", "-m$mid", $inboxdir ];
        ok(run($cmd, \$in, \$out, \$err), "$t edit OK");
        $cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
        like($cur->header('Subject'), qr/boolean prefix/, "$t message edited");
@@ -67,7 +67,7 @@ $t = 'no-op -m MESSAGE_ID'; {
        $in = $out = $err = '';
        my $before = `git $__git_dir rev-parse HEAD`;
        local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/bool pfx/boolean prefix/'";
-       $cmd = [ "$cmd_pfx-edit", "-m$mid", $mainrepo ];
+       $cmd = [ "$cmd_pfx-edit", "-m$mid", $inboxdir ];
        ok(run($cmd, \$in, \$out, \$err), "$t succeeds");
        my $prev = $cur;
        $cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
@@ -84,7 +84,7 @@ $t = 'no-op -m MESSAGE_ID w/Status: header'; { # because mutt does it
        my $before = `git $__git_dir rev-parse HEAD`;
        local $ENV{MAIL_EDITOR} =
                        "$^X -i -p -e 's/^Subject:.*/Status: RO\\n\$&/'";
-       $cmd = [ "$cmd_pfx-edit", "-m$mid", $mainrepo ];
+       $cmd = [ "$cmd_pfx-edit", "-m$mid", $inboxdir ];
        ok(run($cmd, \$in, \$out, \$err), "$t succeeds");
        my $prev = $cur;
        $cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
@@ -102,7 +102,7 @@ $t = '-m MESSAGE_ID can change Received: headers'; {
        my $before = `git $__git_dir rev-parse HEAD`;
        local $ENV{MAIL_EDITOR} =
                        "$^X -i -p -e 's/^Subject:.*/Received: x\\n\$&/'";
-       $cmd = [ "$cmd_pfx-edit", "-m$mid", $mainrepo ];
+       $cmd = [ "$cmd_pfx-edit", "-m$mid", $inboxdir ];
        ok(run($cmd, \$in, \$out, \$err), "$t succeeds");
        $cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
        like($cur->header('Subject'), qr/boolean prefix/,
@@ -113,7 +113,7 @@ $t = '-m MESSAGE_ID can change Received: headers'; {
 $t = '-m miss'; {
        $in = $out = $err = '';
        local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/boolean/FAIL/'";
-       $cmd = [ "$cmd_pfx-edit", "-m$mid-miss", $mainrepo ];
+       $cmd = [ "$cmd_pfx-edit", "-m$mid-miss", $inboxdir ];
        ok(!run($cmd, \$in, \$out, \$err), "$t fails on invalid MID");
        like($err, qr/No message found/, "$t shows error");
 }
@@ -121,7 +121,7 @@ $t = '-m miss'; {
 $t = 'non-interactive editor failure'; {
        $in = $out = $err = '';
        local $ENV{MAIL_EDITOR} = "$^X -i -p -e 'END { exit 1 }'";
-       $cmd = [ "$cmd_pfx-edit", "-m$mid", $mainrepo ];
+       $cmd = [ "$cmd_pfx-edit", "-m$mid", $inboxdir ];
        ok(!run($cmd, \$in, \$out, \$err), "$t detected");
        like($err, qr/END \{ exit 1 \}' failed:/, "$t shows error");
 }
@@ -134,7 +134,7 @@ $t = 'mailEditor set in config'; {
        is($rc, 0, 'set publicinbox.mailEditor');
        local $ENV{MAIL_EDITOR};
        local $ENV{GIT_EDITOR} = 'echo should not run';
-       $cmd = [ "$cmd_pfx-edit", "-m$mid", $mainrepo ];
+       $cmd = [ "$cmd_pfx-edit", "-m$mid", $inboxdir ];
        ok(run($cmd, \$in, \$out, \$err), "$t edited message");
        $cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
        like($cur->header('Subject'), qr/bool pfx/, "$t message edited");
@@ -144,20 +144,20 @@ $t = 'mailEditor set in config'; {
 $t = '--raw and mbox escaping'; {
        $in = $out = $err = '';
        local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/^\$/\\nFrom not mbox\\n/'";
-       $cmd = [ "$cmd_pfx-edit", "-m$mid", '--raw', $mainrepo ];
+       $cmd = [ "$cmd_pfx-edit", "-m$mid", '--raw', $inboxdir ];
        ok(run($cmd, \$in, \$out, \$err), "$t succeeds");
        $cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
        like($cur->body, qr/^From not mbox/sm, 'put "From " line into body');
 
        local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/^>From not/\$& an/'";
-       $cmd = [ "$cmd_pfx-edit", "-m$mid", $mainrepo ];
+       $cmd = [ "$cmd_pfx-edit", "-m$mid", $inboxdir ];
        ok(run($cmd, \$in, \$out, \$err), "$t succeeds with mbox escaping");
        $cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
        like($cur->body, qr/^From not an mbox/sm,
                'changed "From " line unescaped');
 
        local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/^From not an mbox\\n//s'";
-       $cmd = [ "$cmd_pfx-edit", "-m$mid", '--raw', $mainrepo ];
+       $cmd = [ "$cmd_pfx-edit", "-m$mid", '--raw', $inboxdir ];
        ok(run($cmd, \$in, \$out, \$err), "$t succeeds again");
        $cur = PublicInbox::MIME->new($ibx->msg_by_mid($mid));
        unlike($cur->body, qr/^From not an mbox/sm, "$t restored body");
@@ -174,7 +174,7 @@ $t = 'reuse Message-ID'; {
 $t = 'edit ambiguous Message-ID with -m'; {
        $in = $out = $err = '';
        local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/bool pfx/boolean prefix/'";
-       $cmd = [ "$cmd_pfx-edit", "-m$mid", $mainrepo ];
+       $cmd = [ "$cmd_pfx-edit", "-m$mid", $inboxdir ];
        ok(!run($cmd, \$in, \$out, \$err), "$t fails w/o --force");
        like($err, qr/Multiple messages with different content found matching/,
                "$t shows matches");
@@ -184,7 +184,7 @@ $t = 'edit ambiguous Message-ID with -m'; {
 $t .= ' and --force'; {
        $in = $out = $err = '';
        local $ENV{MAIL_EDITOR} = "$^X -i -p -e 's/^Subject:.*/Subject:x/i'";
-       $cmd = [ "$cmd_pfx-edit", "-m$mid", '--force', $mainrepo ];
+       $cmd = [ "$cmd_pfx-edit", "-m$mid", '--force', $inboxdir ];
        ok(run($cmd, \$in, \$out, \$err), "$t succeeds");
        like($err, qr/Will edit all of them/, "$t notes all will be edited");
        my @dump = `git $__git_dir cat-file --batch --batch-all-objects`;
index 4a887b49953df6fbe22369a0e9365eca8f373b74..eb1f35fb0158e6aa357b4f07cde8927040b8a300 100644 (file)
--- a/t/feed.t
+++ b/t/feed.t
@@ -22,7 +22,7 @@ my $git_dir = "$tmpdir/gittest";
 my $ibx = PublicInbox::Inbox->new({
        address => 'test@example',
        name => 'testbox',
-       mainrepo => $git_dir,
+       inboxdir => $git_dir,
        url => 'http://example.com/test',
        feedmax => 3,
 });
index 9ed6684b804a68f5859358331d5d9e8ada6eecce..7b1da11cddf7ed55f441d23b1428d7179c03f286 100644 (file)
@@ -30,7 +30,7 @@ SKIP: {
                                TMPDIR => 1, CLEANUP => 1);
        is(mkdir("$git_dir/public-inbox"), 1, "created public-inbox dir");
        my $altid = [ "serial:ruby-core:file=msgmap.sqlite3" ];
-       my $ibx = PublicInbox::Inbox->new({ mainrepo => $git_dir,
+       my $ibx = PublicInbox::Inbox->new({ inboxdir => $git_dir,
                                                altid => $altid });
        $f = PublicInbox::Filter::RubyLang->new(-inbox => $ibx);
        $msg = <<'EOF';
index b9f866b3e842061744c2dac168df8cd1ea72da18..2f4b4d1b71747b2b42227677f46dc1f072c540aa 100644 (file)
@@ -14,7 +14,7 @@ my $git_dir = "$tmpdir/gittest";
 my $ibx = PublicInbox::Inbox->new({
        address => 'test@example',
        name => 'tester',
-       mainrepo => $git_dir,
+       inboxdir => $git_dir,
        url => 'http://example.com/test',
 });
 my $git = $ibx->git;
index b685da145fefcbe49bfd490186364a2ded5832d1..40afe4e9e7f9234111f1d34247f5fc349c0d6215 100644 (file)
@@ -36,7 +36,7 @@ sub import_index_incremental {
        my $this = "pi-$v-$level-indexlevels";
        my $tmpdir = tempdir("$this-tmp-XXXXXX", TMPDIR => 1, CLEANUP => 1);
        my $ibx = PublicInbox::Inbox->new({
-               mainrepo => "$tmpdir/testbox",
+               inboxdir => "$tmpdir/testbox",
                name => $this,
                version => $v,
                -primary_address => 'test@example.com',
@@ -48,9 +48,9 @@ sub import_index_incremental {
        $im->done;
 
        # index master (required for v1)
-       is(system($index, $ibx->{mainrepo}, "-L$level"), 0, 'index master OK');
+       is(system($index, $ibx->{inboxdir}, "-L$level"), 0, 'index master OK');
        my $ro_master = PublicInbox::Inbox->new({
-               mainrepo => $ibx->{mainrepo},
+               inboxdir => $ibx->{inboxdir},
                indexlevel => $level
        });
        my ($nr, $msgs) = $ro_master->recent;
@@ -61,9 +61,9 @@ sub import_index_incremental {
        my @cmd = (qw(git clone --mirror -q));
        my $mirror = "$tmpdir/mirror-$v";
        if ($v == 1) {
-               push @cmd, $ibx->{mainrepo}, $mirror;
+               push @cmd, $ibx->{inboxdir}, $mirror;
        } else {
-               push @cmd, "$ibx->{mainrepo}/git/0.git", "$mirror/git/0.git";
+               push @cmd, "$ibx->{inboxdir}/git/0.git", "$mirror/git/0.git";
        }
        my $fetch_dir = $cmd[-1];
        is(system(@cmd), 0, "v$v clone OK");
@@ -80,7 +80,7 @@ sub import_index_incremental {
 
        # read-only access
        my $ro_mirror = PublicInbox::Inbox->new({
-               mainrepo => $mirror,
+               inboxdir => $mirror,
                indexlevel => $level,
        });
        ($nr, $msgs) = $ro_mirror->recent;
@@ -101,7 +101,7 @@ sub import_index_incremental {
                ['m@1','m@2'], 'got both messages in mirror');
 
        # incremental index master (required for v1)
-       is(system($index, $ibx->{mainrepo}, "-L$level"), 0, 'index master OK');
+       is(system($index, $ibx->{inboxdir}, "-L$level"), 0, 'index master OK');
        ($nr, $msgs) = $ro_master->recent;
        is($nr, 2, '2nd message seen in master');
        is_deeply([sort { $a cmp $b } map { $_->{mid} } @$msgs],
@@ -137,7 +137,7 @@ sub import_index_incremental {
                'message unavailable in mirror');
 
        if ($v == 2 && $level eq 'basic') {
-               is_deeply([glob("$ibx->{mainrepo}/xap*/?/")], [],
+               is_deeply([glob("$ibx->{inboxdir}/xap*/?/")], [],
                         'no Xapian shard directories for v2 basic');
        }
        if ($level ne 'basic') {
diff --git a/t/mda.t b/t/mda.t
index 3cab590b78f9a9d2728c213706bc229e3ba81aad..1be41bcb34b67b5c4e246666527e331b7953faa8 100644 (file)
--- a/t/mda.t
+++ b/t/mda.t
@@ -38,7 +38,7 @@ my $mime;
 
        my %cfg = (
                "$cfgpfx.address" => $addr,
-               "$cfgpfx.mainrepo" => $maindir,
+               "$cfgpfx.inboxdir" => $maindir,
        );
        while (my ($k,$v) = each %cfg) {
                is(0, system(qw(git config --file), $pi_config, $k, $v),
index 279afaac6e7c58d8928d7894217b6fc86f55232b..f7d872c9c8d351fa115fde92b8429b9ca824bba0 100644 (file)
@@ -27,12 +27,12 @@ for my $v (qw(V1 V2)) {
        my @warn;
        $SIG{__WARN__} = sub { push @warn, @_ };
        my $cfgpfx = "publicinbox.$v";
-       my $mainrepo = "$tmpdir/$v";
+       my $inboxdir = "$tmpdir/$v";
        my $addr = "test-$v\@example.com";
-       my @cmd = ('blib/script/public-inbox-init', "-$v", $v, $mainrepo,
+       my @cmd = ('blib/script/public-inbox-init', "-$v", $v, $inboxdir,
                "http://example.com/$v", $addr);
        is(system(@cmd), 0, 'public-inbox init OK');
-       is(system('blib/script/public-inbox-index', $mainrepo), 0);
+       is(system('blib/script/public-inbox-index', $inboxdir), 0);
        is(system(@cfg, "$cfgpfx.filter", 'PublicInbox::Filter::RubyLang'), 0);
        is(system(@cfg, "$cfgpfx.altid",
                'serial:alerts:file=msgmap.sqlite3'), 0);
index f3a9c7d81e802a6b69c0cc32b80a1f6bf6243df4..aabfd4ffb46798f58240405f0cd70cb0d12fed79 100644 (file)
--- a/t/nntp.t
+++ b/t/nntp.t
@@ -99,7 +99,7 @@ use_ok 'PublicInbox::Inbox';
        require Email::MIME;
        my $u = 'https://example.com/a/';
        my $ng = PublicInbox::Inbox->new({ name => 'test',
-                                       mainrepo => 'test.git',
+                                       inboxdir => 'test.git',
                                        address => 'a@example.com',
                                        -primary_address => 'a@example.com',
                                        newsgroup => 'test',
index 1a74924c81a60ea9997c430a35074be90fdc7674..0b6afcefdff750ec189947a9697505922dbb404f 100644 (file)
@@ -37,7 +37,7 @@ require_git('2.6') if $version >= 2;
 my $tmpdir = tempdir('pi-nntpd-tls-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $err = "$tmpdir/stderr.log";
 my $out = "$tmpdir/stdout.log";
-my $mainrepo = "$tmpdir";
+my $inboxdir = "$tmpdir";
 my $pi_config = "$tmpdir/pi_config";
 my $group = 'test-nntpd-tls';
 my $addr = $group . '@example.com';
@@ -52,7 +52,7 @@ END {
 };
 
 my $ibx = PublicInbox::Inbox->new({
-       mainrepo => $mainrepo,
+       inboxdir => $inboxdir,
        name => 'nntpd-tls',
        version => $version,
        -primary_address => $addr,
@@ -64,7 +64,7 @@ $ibx->init_inbox(0);
        open my $fh, '>', $pi_config or die "open: $!\n";
        print $fh <<EOF
 [publicinbox "nntpd-tls"]
-       mainrepo = $mainrepo
+       inboxdir = $inboxdir
        address = $addr
        indexlevel = basic
        newsgroup = $group
index 87829b03e4dfa2461427f014059acdf7662bf92e..de0243946497a88976b7843476c62d28ee6d4644 100644 (file)
@@ -147,7 +147,7 @@ done_testing();
 sub make_local_server {
        require PublicInbox::Inbox;
        $group = 'inbox.test.perf.nntpd';
-       my $ibx = { mainrepo => $inbox_dir, newsgroup => $group };
+       my $ibx = { inboxdir => $inbox_dir, newsgroup => $group };
        $ibx = PublicInbox::Inbox->new($ibx);
        my $nntpd = 'blib/script/public-inbox-nntpd';
        my $pi_config = "$tmpdir/config";
@@ -156,7 +156,7 @@ sub make_local_server {
                print $fh <<"" or die "print $pi_config: $!";
 [publicinbox "test"]
        newsgroup = $group
-       mainrepo = $inbox_dir
+       inboxdir = $inbox_dir
        address = test\@example.com
 
                close $fh or die "close($pi_config): $!";
index 153204dfdc14d39e3393e451b43dbfc15661b7bb..462e2da97b9922c6c165c5e59977c543fd84e472 100644 (file)
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -26,7 +26,7 @@ my $tmpdir = tempdir('pi-nntpd-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $home = "$tmpdir/pi-home";
 my $err = "$tmpdir/stderr.log";
 my $out = "$tmpdir/stdout.log";
-my $mainrepo = "$tmpdir/main.git";
+my $inboxdir = "$tmpdir/main.git";
 my $group = 'test-nntpd';
 my $addr = $group . '@example.com';
 my $nntpd = 'blib/script/public-inbox-nntpd';
@@ -43,7 +43,7 @@ my $len;
 END { kill 'TERM', $pid if defined $pid };
 
 my $ibx = {
-       mainrepo => $mainrepo,
+       inboxdir => $inboxdir,
        name => $group,
        version => $version,
        -primary_address => $addr,
@@ -52,7 +52,7 @@ my $ibx = {
 $ibx = PublicInbox::Inbox->new($ibx);
 {
        local $ENV{HOME} = $home;
-       my @cmd = ($init, $group, $mainrepo, 'http://example.com/', $addr);
+       my @cmd = ($init, $group, $inboxdir, 'http://example.com/', $addr);
        push @cmd, "-V$version", '-Lbasic';
        is(system(@cmd), 0, 'init OK');
        is(system(qw(git config), "--file=$home/.public-inbox/config",
index 0defafc4ad7d90a07791113af89584eb38949b15..492ed4877a90d517b3ca2ae354121eee0f669eff 100644 (file)
@@ -20,7 +20,7 @@ if (require_git(2.19, 1)) {
 }
 
 use_ok 'Plack::Util';
-my $ibx = PublicInbox::Inbox->new({ mainrepo => $pi_dir, name => 'name' });
+my $ibx = PublicInbox::Inbox->new({ inboxdir => $pi_dir, name => 'name' });
 my $git = $ibx->git;
 my $fh = $git->popen(@cat);
 my $vec = '';
index f272e18add0c13c046c8836e9bd5b5ab47a0a151..7abf2249ef32386ad7677fff22272b2e417d216e 100644 (file)
@@ -27,7 +27,7 @@ if (($ENV{NNTP_TEST_URL} || '') =~ m!\Anntp://([^/]+)/([^/]+)\z!) {
        $host_port .= ":119" unless index($host_port, ':') > 0;
 } else {
        $group = 'inbox.test.perf.nntpd';
-       my $ibx = { mainrepo => $pi_dir, newsgroup => $group };
+       my $ibx = { inboxdir => $pi_dir, newsgroup => $group };
        $ibx = PublicInbox::Inbox->new($ibx);
        my $nntpd = 'blib/script/public-inbox-nntpd';
        my $tmpdir = tempdir('perf-nntpd-XXXXXX', TMPDIR => 1, CLEANUP => 1);
@@ -38,7 +38,7 @@ if (($ENV{NNTP_TEST_URL} || '') =~ m!\Anntp://([^/]+)/([^/]+)\z!) {
                print $fh <<"" or die "print $pi_config: $!";
 [publicinbox "test"]
        newsgroup = $group
-       mainrepo = $pi_dir
+       inboxdir = $pi_dir
        address = test\@example.com
 
                close $fh or die "close($pi_config): $!";
index 3bed05c425349b3d2af19647c3289ca67148a346..8d28b3a0fb8394d18707e187ba9bc32991f23fd7 100644 (file)
@@ -9,7 +9,7 @@ use Benchmark qw(:all);
 use PublicInbox::Inbox;
 my $pi_dir = $ENV{GIANT_PI_DIR};
 plan skip_all => "GIANT_PI_DIR not defined for $0" unless $pi_dir;
-my $ibx = PublicInbox::Inbox->new({ mainrepo => $pi_dir });
+my $ibx = PublicInbox::Inbox->new({ inboxdir => $pi_dir });
 eval { require PublicInbox::Search };
 my $srch = $ibx->search;
 plan skip_all => "$pi_dir not configured for search $0 $@" unless $srch;
index f9a55e4366b5d98c4cad0d480a1dda4f08bc5668..7e65ad742e8f03ccc9102668fb1b3d09a5a5b37f 100644 (file)
--- a/t/plack.t
+++ b/t/plack.t
@@ -29,7 +29,7 @@ foreach my $mod (@mods) { use_ok $mod; }
        close $fh or die "close: $!\n";
        my %cfg = (
                "$cfgpfx.address" => $addr,
-               "$cfgpfx.mainrepo" => $maindir,
+               "$cfgpfx.inboxdir" => $maindir,
                "$cfgpfx.url" => 'http://example.com/test/',
                "$cfgpfx.newsgroup" => 'inbox.test',
        );
index f5140f44c308371e4971439833fa6919d8f4f49c..96f0cb473ae714b4b39b6fe48591845d75531460 100644 (file)
@@ -23,7 +23,7 @@ use_ok 'PublicInbox::WwwAttach';
 use Plack::Builder;
 my $config = PublicInbox::Config->new(\<<EOF);
 $cfgpfx.address=$addr
-$cfgpfx.mainrepo=$maindir
+$cfgpfx.inboxdir=$maindir
 EOF
 is(0, system(qw(git init -q --bare), $maindir), "git init (main)");
 my $git = PublicInbox::Git->new($maindir);
index 95196a3f4b91f18859791090845be414d17ba00e..c7c947188e9499622b8562365c86de91a42d7e4a 100644 (file)
@@ -15,10 +15,10 @@ foreach my $mod (@mods) {
 }
 use_ok($_) for @mods;
 use_ok 'PublicInbox::V2Writable';
-my $mainrepo = tempdir('pi-bad-mids-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+my $inboxdir = tempdir('pi-bad-mids-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $cfgpfx = "publicinbox.bad-mids";
 my $ibx = {
-       mainrepo => $mainrepo,
+       inboxdir => $inboxdir,
        name => 'bad-mids',
        version => 2,
        -primary_address => 'test@example.com',
@@ -55,7 +55,7 @@ $im->done;
 
 my $cfg = <<EOF;
 $cfgpfx.address=$ibx->{-primary_address}
-$cfgpfx.mainrepo=$mainrepo
+$cfgpfx.inboxdir=$inboxdir
 EOF
 my $config = PublicInbox::Config->new(\$cfg);
 my $www = PublicInbox::WWW->new($config);
index 7160896bb6c2f5071f6e7572ba5e643e89a73938..aa7c863f5274421e528c4a4e79d28a48a27b41db 100644 (file)
@@ -23,7 +23,7 @@ use Plack::Builder;
 use Plack::App::URLMap;
 my $config = PublicInbox::Config->new(\<<EOF);
 $cfgpfx.address=$addr
-$cfgpfx.mainrepo=$maindir
+$cfgpfx.inboxdir=$maindir
 EOF
 is(0, system(qw(git init -q --bare), $maindir), "git init (main)");
 my $git = PublicInbox::Git->new($maindir);
index 2670c47a76f9afae7a5fc6738d168ac4dc27eb4a..40bc3c18c6c8e423c306521af87defbb95b2ef69 100644 (file)
@@ -17,7 +17,7 @@ use_ok($_) for @mods;
 use_ok 'PublicInbox::V2Writable';
 my $repo = tempdir('pi-psgi-multipart-not.XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $ibx = PublicInbox::Inbox->new({
-       mainrepo => $repo,
+       inboxdir => $repo,
        name => 'multipart-not',
        version => 2,
        -primary_address => 'test@example.com',
@@ -44,7 +44,7 @@ $im->done;
 my $cfgpfx = "publicinbox.v2test";
 my $cfg = <<EOF;
 $cfgpfx.address=$ibx->{-primary_address}
-$cfgpfx.mainrepo=$repo
+$cfgpfx.inboxdir=$repo
 EOF
 my $config = PublicInbox::Config->new(\$cfg);
 my $www = PublicInbox::WWW->new($config);
index 2e00b6d843160e43391f2d54b8dc5227f181b42f..707807a7f0ac21caf5795facabeaaa009dec1be2 100644 (file)
@@ -19,12 +19,12 @@ my $cfg = '';
 foreach my $i (1..2) {
        my $cfgpfx = "publicinbox.test-$i";
        my $addr = "test-$i\@example.com";
-       my $mainrepo = "$tmp/$i";
+       my $inboxdir = "$tmp/$i";
        $cfg .= "$cfgpfx.address=$addr\n";
-       $cfg .= "$cfgpfx.mainrepo=$mainrepo\n";
+       $cfg .= "$cfgpfx.inboxdir=$inboxdir\n";
        $cfg .= "$cfgpfx.url=http://example.com/$i\n";
        my $opt = {
-               mainrepo => $mainrepo,
+               inboxdir => $inboxdir,
                name => "test-$i",
                version => 2,
                indexlevel => 'basic',
index ab6892bcfc205aa9ffcdbdc5b595350d456ecf0a..4cd0e499c1841035e72877feb22c9a0c75a513d1 100644 (file)
@@ -21,7 +21,7 @@ use_ok $_ foreach (@mods, qw(PublicInbox::SearchIdx));
 my $tmpdir = tempdir('pi-psgi-search.XXXXXX', TMPDIR => 1, CLEANUP => 1);
 
 my $ibx = PublicInbox::Inbox->new({
-       mainrepo => $tmpdir,
+       inboxdir => $tmpdir,
        address => 'git@vger.kernel.org',
        name => 'test',
 });
@@ -47,7 +47,7 @@ PublicInbox::SearchIdx->new($ibx, 1)->index_sync;
 my $cfgpfx = "publicinbox.test";
 my $config = PublicInbox::Config->new(\<<EOF);
 $cfgpfx.address=git\@vger.kernel.org
-$cfgpfx.mainrepo=$tmpdir
+$cfgpfx.inboxdir=$tmpdir
 EOF
 my $www = PublicInbox::WWW->new($config);
 test_psgi(sub { $www->call(@_) }, sub {
index 944a647637ba011140808c19c1de5650833dd1d6..da7c6f57ba6a49d8db34917a43e9dc480b032e48 100644 (file)
@@ -23,7 +23,7 @@ use_ok 'PublicInbox::WwwText';
 use Plack::Builder;
 my $config = PublicInbox::Config->new(\<<EOF);
 $cfgpfx.address=$addr
-$cfgpfx.mainrepo=$maindir
+$cfgpfx.inboxdir=$maindir
 EOF
 is(0, system(qw(git init -q --bare), $maindir), "git init (main)");
 my $www = PublicInbox::WWW->new($config);
index e4f7306e1606b3f93abcb33471f5b817d65c72b7..cb5ece638b1d79f334ab96f90ff30ba7585f62d9 100644 (file)
@@ -18,9 +18,9 @@ foreach my $mod (@mods) {
 }
 use_ok($_) for @mods;
 use_ok 'PublicInbox::V2Writable';
-my $mainrepo = tempdir('pi-v2_dupes-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+my $inboxdir = tempdir('pi-v2_dupes-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $ibx = {
-       mainrepo => $mainrepo,
+       inboxdir => $inboxdir,
        name => 'test-v2writable',
        version => 2,
        -primary_address => 'test@example.com',
@@ -56,7 +56,7 @@ $im->done;
 my $cfgpfx = "publicinbox.v2test";
 my $cfg = <<EOF;
 $cfgpfx.address=$ibx->{-primary_address}
-$cfgpfx.mainrepo=$mainrepo
+$cfgpfx.inboxdir=$inboxdir
 EOF
 my $config = PublicInbox::Config->new(\$cfg);
 my $www = PublicInbox::WWW->new($config);
index 384f32a652bfce92eb917093cfbc5ba37002c9bc..67c4e58d47e9f5ee444e74ddddcbcaf95611f97c 100644 (file)
--- a/t/purge.t
+++ b/t/purge.t
@@ -15,9 +15,9 @@ use Cwd qw(abs_path);
 my $purge = abs_path('blib/script/public-inbox-purge');
 my $tmpdir = tempdir('pi-purge-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 use_ok 'PublicInbox::V2Writable';
-my $mainrepo = "$tmpdir/v2";
+my $inboxdir = "$tmpdir/v2";
 my $ibx = PublicInbox::Inbox->new({
-       mainrepo => $mainrepo,
+       inboxdir => $inboxdir,
        name => 'test-v2purge',
        version => 2,
        -primary_address => 'test@example.com',
@@ -47,22 +47,22 @@ $v2w->done;
 # failing cases, first:
 my $in = "$raw\nMOAR\n";
 my ($out, $err) = ('', '');
-ok(IPC::Run::run([$purge, '-f', $mainrepo], \$in, \$out, \$err),
+ok(IPC::Run::run([$purge, '-f', $inboxdir], \$in, \$out, \$err),
        'purge -f OK');
 
 $out = $err = '';
-ok(!IPC::Run::run([$purge, $mainrepo], \$in, \$out, \$err),
+ok(!IPC::Run::run([$purge, $inboxdir], \$in, \$out, \$err),
        'mismatch fails without -f');
 is($? >> 8, 1, 'missed purge exits with 1');
 
 # a successful case:
-ok(IPC::Run::run([$purge, $mainrepo], \$raw, \$out, \$err), 'match OK');
+ok(IPC::Run::run([$purge, $inboxdir], \$raw, \$out, \$err), 'match OK');
 like($out, qr/\b[a-f0-9]{40,}/m, 'removed commit noted');
 
 # add (old) vger filter to config file
 print $cfg_fh <<EOF or die "print $!";
 [publicinbox "test-v2purge"]
-       mainrepo = $mainrepo
+       inboxdir = $inboxdir
        address = test\@example.com
        indexlevel = basic
        filter = PublicInbox::Filter::Vger
index b1ee15bf6788380ceef0e672d0354c0149da9865..24f7537c4ed8c1739cf682b720bb376187ba5ab5 100644 (file)
@@ -19,7 +19,7 @@ sub test_replace ($$$) {
        my $this = "pi-$v-$level-replace";
        my $tmpdir = tempdir("$this-tmp-XXXXXX", TMPDIR => 1, CLEANUP => 1);
        my $ibx = PublicInbox::Inbox->new({
-               mainrepo => "$tmpdir/testbox",
+               inboxdir => "$tmpdir/testbox",
                name => $this,
                version => $v,
                -primary_address => 'test@example.com',
@@ -95,7 +95,7 @@ EOF
        my $t19931002 = qr/ 749520000 /;
        is_deeply([grep(/$t19931002/, @all)], [], "nothing matches $t19931002");
 
-       for my $dir (glob("$ibx->{mainrepo}/git/*.git")) {
+       for my $dir (glob("$ibx->{inboxdir}/git/*.git")) {
                my ($bn) = ($dir =~ m!([^/]+)\z!);
                is(system(qw(git --git-dir), $dir, qw(fsck --strict)), 0,
                        "git fsck is clean in epoch $bn");
index 4b26f2ee34580c9d3e074afe83f5513fcc0466e9..26339989cf8de4592f2bfa31476689aed8897546 100644 (file)
@@ -18,7 +18,7 @@ my $tmpdir = tempdir('pi-search-thr-index.XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $git_dir = "$tmpdir/a.git";
 
 is(0, system(qw(git init -q --bare), $git_dir), "git init (main)");
-my $ibx = PublicInbox::Inbox->new({mainrepo => $git_dir});
+my $ibx = PublicInbox::Inbox->new({inboxdir => $git_dir});
 my $rw = PublicInbox::SearchIdx->new($ibx, 1);
 ok($rw, "search indexer created");
 my $data = <<'EOF';
index a728d79f77aa725355f9eaa8da4f1d9fc269adaa..b6531ab37bf5c4009f310aaa628a4991230c9e7e 100644 (file)
@@ -14,7 +14,7 @@ use File::Temp qw/tempdir/;
 use Email::MIME;
 my $tmpdir = tempdir('pi-search-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $git_dir = "$tmpdir/a.git";
-my $ibx = PublicInbox::Inbox->new({ mainrepo => $git_dir });
+my $ibx = PublicInbox::Inbox->new({ inboxdir => $git_dir });
 my ($root_id, $last_id);
 
 is(0, system(qw(git init --shared -q --bare), $git_dir), "git init (main)")
index 0b7d7c49485088d123d9c0040a5db61531955268..baab40a49a3d72bd85b029786dedb140fbfeb6d3 100644 (file)
@@ -22,9 +22,9 @@ $git_dir = abs_path($git_dir);
 
 use_ok "PublicInbox::$_" for (qw(Inbox V2Writable MIME Git SolverGit));
 
-my $mainrepo = tempdir('pi-solver-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+my $inboxdir = tempdir('pi-solver-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $opts = {
-       mainrepo => $mainrepo,
+       inboxdir => $inboxdir,
        name => 'test-v2writable',
        version => 2,
        -primary_address => 'test@example.com',
@@ -52,7 +52,7 @@ is(undef, $git->commit_title('impossible'), 'undef on impossible object');
 $ibx->{-repo_objs} = [ $git ];
 my $res;
 my $solver = PublicInbox::SolverGit->new($ibx, sub { $res = $_[0] });
-open my $log, '+>>', "$mainrepo/solve.log" or die "open: $!";
+open my $log, '+>>', "$inboxdir/solve.log" or die "open: $!";
 my $psgi_env = { 'psgi.errors' => *STDERR };
 $solver->solve($psgi_env, $log, '69df7d5', {});
 ok($res, 'solved a blob!');
index 4777a307848e06452cdd8bb48f505145e10d6e23..3facd87e10bb7919e73231ef0033d4a5594478c4 100644 (file)
@@ -12,10 +12,10 @@ foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
        plan skip_all => "$mod missing for v1-add-remove-add.t" if $@;
 }
 require PublicInbox::SearchIdx;
-my $mainrepo = tempdir('pi-add-remove-add-XXXXXX', TMPDIR => 1, CLEANUP => 1);
-is(system(qw(git init --bare), $mainrepo), 0);
+my $inboxdir = tempdir('pi-add-remove-add-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+is(system(qw(git init --bare), $inboxdir), 0);
 my $ibx = {
-       mainrepo => $mainrepo,
+       inboxdir => $inboxdir,
        name => 'test-add-remove-add',
        -primary_address => 'test@example.com',
 };
index d14a117d3663099688e594226ae66a051fcd2d26..e35477535800626e47bda9bd64546c32d3514098 100644 (file)
@@ -16,10 +16,10 @@ foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
 }
 use_ok 'PublicInbox::SearchIdx';
 use_ok 'PublicInbox::Import';
-my $mainrepo = tempdir('pi-v1reindex-XXXXXX', TMPDIR => 1, CLEANUP => 1);
-is(system(qw(git init -q --bare), $mainrepo), 0);
+my $inboxdir = tempdir('pi-v1reindex-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+is(system(qw(git init -q --bare), $inboxdir), 0);
 my $ibx_config = {
-       mainrepo => $mainrepo,
+       inboxdir => $inboxdir,
        name => 'test-v1reindex',
        -primary_address => 'test@example.com',
        indexlevel => 'full',
@@ -96,7 +96,7 @@ my ($mark1, $mark2, $mark3, $mark4);
        is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
 }
 
-my $xap = "$mainrepo/public-inbox/xapian".PublicInbox::Search::SCHEMA_VERSION();
+my $xap = "$inboxdir/public-inbox/xapian".PublicInbox::Search::SCHEMA_VERSION();
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed');
 {
@@ -118,7 +118,7 @@ ok(!-d $xap, 'Xapian directories removed');
        is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
 }
 
-ok(unlink "$mainrepo/public-inbox/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/public-inbox/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
@@ -141,7 +141,7 @@ ok(!-d $xap, 'Xapian directories removed again');
        is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
 }
 
-ok(unlink "$mainrepo/public-inbox/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/public-inbox/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
@@ -164,7 +164,7 @@ ok(!-d $xap, 'Xapian directories removed again');
        is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
 }
 
-ok(unlink "$mainrepo/public-inbox/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/public-inbox/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
@@ -190,7 +190,7 @@ ok(!-d $xap, 'Xapian directories removed again');
        is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
 }
 
-ok(unlink "$mainrepo/public-inbox/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/public-inbox/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
@@ -239,7 +239,7 @@ ok(!-d $xap, 'Xapian directories removed again');
 }
 
 # An incremental indexing test
-ok(unlink "$mainrepo/public-inbox/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/public-inbox/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
@@ -349,7 +349,7 @@ ok(!-d $xap, 'Xapian directories removed again');
 
 
 # Another incremental indexing test
-ok(unlink "$mainrepo/public-inbox/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/public-inbox/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
index c758dbb6728e8dd7a27a9a8f2812c45fdce2700f..438fe3db7367d934da926935f6d35f06a22cf5d9 100644 (file)
@@ -13,9 +13,9 @@ foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
        plan skip_all => "$mod missing for v2-add-remove-add.t" if $@;
 }
 use_ok 'PublicInbox::V2Writable';
-my $mainrepo = tempdir('pi-add-remove-add-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+my $inboxdir = tempdir('pi-add-remove-add-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $ibx = {
-       mainrepo => "$mainrepo/v2",
+       inboxdir => "$inboxdir/v2",
        name => 'test-v2writable',
        version => 2,
        -primary_address => 'test@example.com',
index 92b3333e3cb271e513241fdd4aa7062edc1a70a2..ebcbd1f4dde040047601a790ca1f2bf0caae80e6 100644 (file)
--- a/t/v2mda.t
+++ b/t/v2mda.t
@@ -18,7 +18,7 @@ foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
 use_ok 'PublicInbox::V2Writable';
 my $tmpdir = tempdir('pi-v2mda-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $ibx = {
-       mainrepo => "$tmpdir/inbox",
+       inboxdir => "$tmpdir/inbox",
        name => 'test-v2writable',
        address => [ 'test@example.com' ],
 };
@@ -45,7 +45,7 @@ my $faildir = "$tmpdir/fail";
 local $ENV{PI_EMERGENCY} = $faildir;
 ok(mkdir $faildir);
 my @cmd = (qw(public-inbox-init), "-V$V", $ibx->{name},
-               $ibx->{mainrepo}, 'http://localhost/test',
+               $ibx->{inboxdir}, 'http://localhost/test',
                $ibx->{address}->[0]);
 ok(PublicInbox::Import::run_die(\@cmd), 'initialized v2 inbox');
 
index 86ca895d34aaa130cf05ebfc0973854d82e3e4b7..a097a7f3a2cd0da80f109ec098210c034d0eef43 100644 (file)
@@ -28,7 +28,7 @@ my $pi_config = "$tmpdir/config";
        open my $fh, '>', $pi_config or die "open($pi_config): $!";
        print $fh <<"" or die "print $pi_config: $!";
 [publicinbox "v2"]
-       mainrepo = $tmpdir/in
+       inboxdir = $tmpdir/in
        address = test\@example.com
 
        close $fh or die "close($pi_config): $!";
@@ -88,7 +88,7 @@ foreach my $i (0..$epoch_max) {
 is(system(@cmd), 0, 'initialized public-inbox -V2');
 is(system("$script-index", "$tmpdir/m"), 0, 'indexed');
 
-my $mibx = { mainrepo => "$tmpdir/m", address => 'alt@example.com' };
+my $mibx = { inboxdir => "$tmpdir/m", address => 'alt@example.com' };
 $mibx = PublicInbox::Inbox->new($mibx);
 is_deeply([$mibx->mm->minmax], [$ibx->mm->minmax], 'index synched minmax');
 
index 1dcefbe36b0f5bb2f40e42209bb593f15ed13355..7c5a6b07bb4f055f3bc9501577a7daf54410b61b 100644 (file)
@@ -15,9 +15,9 @@ foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
        plan skip_all => "$mod missing for v2reindex.t" if $@;
 }
 use_ok 'PublicInbox::V2Writable';
-my $mainrepo = tempdir('pi-v2reindex-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+my $inboxdir = tempdir('pi-v2reindex-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $ibx_config = {
-       mainrepo => $mainrepo,
+       inboxdir => $inboxdir,
        name => 'test-v2writable',
        version => 2,
        -primary_address => 'test@example.com',
@@ -100,7 +100,7 @@ my ($mark1, $mark2, $mark3, $mark4);
        is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
 }
 
-my $xap = "$mainrepo/xap".PublicInbox::Search::SCHEMA_VERSION();
+my $xap = "$inboxdir/xap".PublicInbox::Search::SCHEMA_VERSION();
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed');
 {
@@ -120,7 +120,7 @@ ok(!-d $xap, 'Xapian directories removed');
        is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
 }
 
-ok(unlink "$mainrepo/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
@@ -143,7 +143,7 @@ ok(!-d $xap, 'Xapian directories removed again');
 }
 
 my %sizes;
-ok(unlink "$mainrepo/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
@@ -168,7 +168,7 @@ ok(!-d $xap, 'Xapian directories removed again');
        is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
 }
 
-ok(unlink "$mainrepo/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
@@ -207,7 +207,7 @@ ok(!-d $xap, 'Xapian directories removed again');
        is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged');
 }
 
-ok(unlink "$mainrepo/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
@@ -237,7 +237,7 @@ ok(!-d $xap, 'Xapian directories removed again');
 
 
 # An incremental indexing test
-ok(unlink "$mainrepo/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
@@ -347,7 +347,7 @@ ok(!-d $xap, 'Xapian directories removed again');
 
 
 # Another incremental indexing test
-ok(unlink "$mainrepo/msgmap.sqlite3", 'remove msgmap');
+ok(unlink "$inboxdir/msgmap.sqlite3", 'remove msgmap');
 remove_tree($xap);
 ok(!-d $xap, 'Xapian directories removed again');
 {
index c1c9196fb4df00b088d8a4032f69dc7f58f58f9b..c2daac2f8484b4feb72ea752948af6cf9ac2cd2f 100644 (file)
@@ -14,9 +14,9 @@ foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
 }
 use_ok 'PublicInbox::V2Writable';
 umask 007;
-my $mainrepo = tempdir('pi-v2writable-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+my $inboxdir = tempdir('pi-v2writable-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $ibx = {
-       mainrepo => $mainrepo,
+       inboxdir => $inboxdir,
        name => 'test-v2writable',
        version => 2,
        -primary_address => 'test@example.com',
@@ -36,9 +36,9 @@ my $mime = PublicInbox::MIME->create(
 my $im = PublicInbox::V2Writable->new($ibx, {nproc => 1});
 is($im->{shards}, 1, 'one shard when forced');
 ok($im->add($mime), 'ordinary message added');
-foreach my $f ("$mainrepo/msgmap.sqlite3",
-               glob("$mainrepo/xap*/*"),
-               glob("$mainrepo/xap*/*/*")) {
+foreach my $f ("$inboxdir/msgmap.sqlite3",
+               glob("$inboxdir/xap*/*"),
+               glob("$inboxdir/xap*/*/*")) {
        my @st = stat($f);
        my ($bn) = (split(m!/!, $f))[-1];
        is($st[2] & 07777, -f _ ? 0660 : 0770,
@@ -48,10 +48,10 @@ foreach my $f ("$mainrepo/msgmap.sqlite3",
 my $git0;
 
 if ('ensure git configs are correct') {
-       my @cmd = (qw(git config), "--file=$mainrepo/all.git/config",
+       my @cmd = (qw(git config), "--file=$inboxdir/all.git/config",
                qw(core.sharedRepository 0644));
        is(system(@cmd), 0, "set sharedRepository in all.git");
-       $git0 = PublicInbox::Git->new("$mainrepo/git/0.git");
+       $git0 = PublicInbox::Git->new("$inboxdir/git/0.git");
        chomp(my $v = $git0->qx(qw(config core.sharedRepository)));
        is($v, '0644', 'child repo inherited core.sharedRepository');
        chomp($v = $git0->qx(qw(config --bool repack.writeBitmaps)));
@@ -131,14 +131,14 @@ if ('ensure git configs are correct') {
 
 {
        use Net::NNTP;
-       my $err = "$mainrepo/stderr.log";
-       my $out = "$mainrepo/stdout.log";
+       my $err = "$inboxdir/stderr.log";
+       my $out = "$inboxdir/stdout.log";
        my $group = 'inbox.comp.test.v2writable';
-       my $pi_config = "$mainrepo/pi_config";
+       my $pi_config = "$inboxdir/pi_config";
        open my $fh, '>', $pi_config or die "open: $!\n";
        print $fh <<EOF
 [publicinbox "test-v2writable"]
-       mainrepo = $mainrepo
+       inboxdir = $inboxdir
        version = 2
        address = test\@example.com
        newsgroup = $group
index b28d699aa24455a25f22e64b0f5704e72d66d288..4b88d670e84382f611ad6f047d76642ab68eec36 100644 (file)
@@ -32,15 +32,15 @@ for my $v (@v) {
        my @warn;
        $SIG{__WARN__} = sub { push @warn, @_ };
        my $cfgpfx = "publicinbox.$v";
-       my $mainrepo = "$tmpdir/$v";
+       my $inboxdir = "$tmpdir/$v";
        my $maildir = "$tmpdir/md-$v";
        my $spamdir = "$tmpdir/spam-$v";
        my $addr = "test-$v\@example.com";
-       my @cmd = ('blib/script/public-inbox-init', "-$v", $v, $mainrepo,
+       my @cmd = ('blib/script/public-inbox-init', "-$v", $v, $inboxdir,
                "http://example.com/$v", $addr);
        is(system(@cmd), 0, 'public-inbox init OK');
        if ($v eq 'V1') {
-               is(system('blib/script/public-inbox-index', $mainrepo), 0);
+               is(system('blib/script/public-inbox-index', $inboxdir), 0);
        }
        PublicInbox::Emergency->new($spamdir);
 
@@ -72,7 +72,7 @@ EOF
 
        my $orig = <<EOF;
 $cfgpfx.address=$addr
-$cfgpfx.mainrepo=$mainrepo
+$cfgpfx.inboxdir=$inboxdir
 $cfgpfx.watch=maildir:$maildir
 $cfgpfx.filter=PublicInbox::Filter::RubyLang
 $cfgpfx.altid=serial:alerts:file=msgmap.sqlite3
index e65ab9a947a339082e4e15dac4410ef601f5154c..e6cd599cafb949a7b155f5b26bb424bb00a2bae3 100644 (file)
@@ -37,7 +37,7 @@ my $sem = PublicInbox::Emergency->new($spamdir); # create dirs
 
 my $config = PublicInbox::Config->new(\<<EOF);
 $cfgpfx.address=$addr
-$cfgpfx.mainrepo=$git_dir
+$cfgpfx.inboxdir=$git_dir
 $cfgpfx.watch=maildir:$maildir
 $cfgpfx.filter=PublicInbox::Filter::Vger
 publicinboxlearn.watchspam=maildir:$spamdir
index 99551ceb7d51191c8dac2cab0482ed50e013bac2..ccc85c173d078719083e6ef83075841f17817e96 100644 (file)
@@ -14,14 +14,14 @@ foreach my $mod (@mods) {
 }
 require PublicInbox::V2Writable;
 my $tmpdir = tempdir('watch_maildir-v2-XXXXXX', TMPDIR => 1, CLEANUP => 1);
-my $mainrepo = "$tmpdir/v2";
+my $inboxdir = "$tmpdir/v2";
 my $maildir = "$tmpdir/md";
 my $spamdir = "$tmpdir/spam";
 use_ok 'PublicInbox::WatchMaildir';
 use_ok 'PublicInbox::Emergency';
 my $cfgpfx = "publicinbox.test";
 my $addr = 'test-public@example.com';
-my @cmd = ('blib/script/public-inbox-init', '-V2', 'test', $mainrepo,
+my @cmd = ('blib/script/public-inbox-init', '-V2', 'test', $inboxdir,
        'http://example.com/v2list', $addr);
 local $ENV{PI_CONFIG} = "$tmpdir/pi_config";
 is(system(@cmd), 0, 'public-inbox init OK');
@@ -42,7 +42,7 @@ my $sem = PublicInbox::Emergency->new($spamdir); # create dirs
 
 my $orig = <<EOF;
 $cfgpfx.address=$addr
-$cfgpfx.mainrepo=$mainrepo
+$cfgpfx.inboxdir=$inboxdir
 $cfgpfx.watch=maildir:$maildir
 $cfgpfx.filter=PublicInbox::Filter::Vger
 publicinboxlearn.watchspam=maildir:$spamdir
@@ -56,7 +56,7 @@ PublicInbox::WatchMaildir->new($config)->scan('full');
 my ($total, undef) = $srch->reopen->query('');
 is($total, 1, 'got one revision');
 
-# my $git = PublicInbox::Git->new("$mainrepo/git/0.git");
+# my $git = PublicInbox::Git->new("$inboxdir/git/0.git");
 # my @list = $git->qx(qw(rev-list refs/heads/master));
 # is(scalar @list, 1, 'one revision in rev-list');
 
@@ -148,7 +148,7 @@ More majordomo info at  http://vger.kernel.org/majordomo-info.html\n);
        is(system(qw(git init -q --bare), $v1repo), 0, 'v1 init OK');
        my $cfg2 = <<EOF;
 $orig$v1pfx.address=$v1addr
-$v1pfx.mainrepo=$v1repo
+$v1pfx.inboxdir=$v1repo
 $v1pfx.watch=maildir:$maildir
 EOF
        my $config = PublicInbox::Config->new(\$cfg2);
index 990233c8ba203a5ce53b4c866c24901c402a7697..9f71257d1361facc58f8f21cf598783767abfc71 100644 (file)
@@ -91,15 +91,15 @@ SKIP: {
        open $fh, '>', $cfgfile or die;
        print $fh <<"" or die;
 [publicinbox "bare"]
-       mainrepo = $bare->{git_dir}
+       inboxdir = $bare->{git_dir}
        url = http://$host/bare
        address = bare\@example.com
 [publicinbox "alt"]
-       mainrepo = $alt
+       inboxdir = $alt
        url = http://$host/alt
        address = alt\@example.com
 [publicinbox "v2"]
-       mainrepo = $v2
+       inboxdir = $v2
        url = http://$host/v2
        address = v2\@example.com
 
index d921e12f562ccc163995b58e04146c0582d2a683..43e08639d8ba72e0f3894f5d6f49eefabd1544a4 100644 (file)
@@ -27,7 +27,7 @@ my $mime = PublicInbox::MIME->create(
 my ($this) = (split('/', $0))[-1];
 my $tmpdir = tempdir($this.'-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $ibx = PublicInbox::Inbox->new({
-       mainrepo => "$tmpdir/testbox",
+       inboxdir => "$tmpdir/testbox",
        name => $this,
        version => 2,
        -primary_address => 'test@example.com',
@@ -43,7 +43,7 @@ for my $i (1..$ndoc) {
        ok($im->add($mime), "message $i added");
 }
 $im->done;
-my @shards = grep(m!/\d+\z!, glob("$ibx->{mainrepo}/xap*/*"));
+my @shards = grep(m!/\d+\z!, glob("$ibx->{inboxdir}/xap*/*"));
 is(scalar(@shards), $nproc, 'got expected shards');
 my $orig = $ibx->over->query_xover(1, $ndoc);
 my %nums = map {; "$_->{num}" => 1 } @$orig;
@@ -51,8 +51,8 @@ my %nums = map {; "$_->{num}" => 1 } @$orig;
 # ensure we can go up or down in shards, or stay the same:
 for my $R (qw(2 4 1 3 3)) {
        delete $ibx->{search}; # release old handles
-       is(system(@xcpdb, "-R$R", $ibx->{mainrepo}), 0, "xcpdb -R$R");
-       my @new_shards = grep(m!/\d+\z!, glob("$ibx->{mainrepo}/xap*/*"));
+       is(system(@xcpdb, "-R$R", $ibx->{inboxdir}), 0, "xcpdb -R$R");
+       my @new_shards = grep(m!/\d+\z!, glob("$ibx->{inboxdir}/xap*/*"));
        is(scalar(@new_shards), $R, 'resharded to two shards');
        my $msgs = $ibx->search->query('s:this');
        is(scalar(@$msgs), $ndoc, 'got expected docs after resharding');