File::Spec->rel2abs($p, $pwd);
}
-sub _store_path ($) {
+sub store_path ($) {
my ($self) = @_;
rel2abs($self, ($self->{env}->{XDG_DATA_HOME} //
($self->{env}->{HOME} // '/nonexistent').'/.local/share')
}, qw(config-file|system|global|file|f=s), # for conflict detection
qw(C=s@), pass_through('git config') ],
'init' => [ '[DIRNAME]', sub {
- "initialize storage, default: "._store_path($_[0]);
+ "initialize storage, default: ".store_path($_[0]);
}, qw(quiet|q C=s@) ],
'daemon-kill' => [ '[-SIGNAL]', 'signal the lei-daemon',
# "-C DIR" conflicts with -CHLD, here, and chdir makes no sense, here
$cfg->{-lei_store} //= do {
require PublicInbox::LeiStore;
my $dir = $cfg->{'leistore.dir'};
- $dir //= $creat ? _store_path($self) : return;
+ $dir //= $creat ? store_path($self) : return;
PublicInbox::LeiStore->new($dir, { creat => $creat });
};
}
my ($self, $dir) = @_;
my $cfg = _lei_cfg($self, 1);
my $cur = $cfg->{'leistore.dir'};
- $dir //= _store_path($self);
+ $dir //= store_path($self);
$dir = rel2abs($self, $dir);
my @cur = stat($cur) if defined($cur);
$cur = File::Spec->canonpath($cur // $dir);
my ($self, $lei) = @_;
unless ($self->{-ipc_req}) {
require PublicInbox::LeiXSearch;
- $self->ipc_lock_init;
+ $self->ipc_lock_init($lei->store_path . '/ipc.lock');
# Mail we import into lei are private, so headers filtered out
# by -mda for public mail are not appropriate
local @PublicInbox::MDA::BAD_HEADERS = ();