From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 675BD1F9FC; Fri, 26 Mar 2021 05:01:31 +0000 (UTC) Date: Fri, 26 Mar 2021 06:01:31 +0100 From: Eric Wong To: meta@public-inbox.org Subject: [SQUASH 4/3] lei: account for unconfigured leistore.dir Message-ID: <20210326050131.GA20425@dcvr> References: <20210326042937.15913-1-e@80x24.org> <20210326042937.15913-3-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210326042937.15913-3-e@80x24.org> List-Id: We just use the default directory if it's not in the config. --- lib/PublicInbox/LEI.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index fab2af90..6a5c32b3 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -702,8 +702,9 @@ sub _lei_cfg ($;$) { bless $cfg, 'PublicInbox::Config'; $cfg->{-st} = $cur_st; $cfg->{'-f'} = $f; - if ($sto && File::Spec->canonpath($sto_dir) eq - File::Spec->canonpath($cfg->{'leistore.dir'})) { + if ($sto && File::Spec->canonpath($sto_dir // store_path($self)) + eq File::Spec->canonpath($cfg->{'leistore.dir'} // + store_path($self))) { $cfg->{-lei_store} = $sto; } if (scalar(keys %PATH2CFG) > 5) {