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 B87341FB05 for ; Sat, 7 Nov 2020 10:57:06 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 07/10] extsearch: canonicalize topdir Date: Sat, 7 Nov 2020 10:56:57 +0000 Message-Id: <20201107105700.12586-8-e@80x24.org> In-Reply-To: <20201107105700.12586-1-e@80x24.org> References: <20201107105700.12586-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This makes `ps' output look a bit nicer if there's trailing slashes involved from the command-line. --- lib/PublicInbox/ExtSearch.pm | 2 ++ lib/PublicInbox/ExtSearchIdx.pm | 1 + 2 files changed, 3 insertions(+) diff --git a/lib/PublicInbox/ExtSearch.pm b/lib/PublicInbox/ExtSearch.pm index 66c99eaa..eb665027 100644 --- a/lib/PublicInbox/ExtSearch.pm +++ b/lib/PublicInbox/ExtSearch.pm @@ -9,12 +9,14 @@ use strict; use v5.10.1; use PublicInbox::Over; use PublicInbox::Inbox; +use File::Spec (); # for ->reopen, ->mset, ->mset_to_artnums use parent qw(PublicInbox::Search); sub new { my (undef, $topdir) = @_; + $topdir = File::Spec->canonpath($topdir); bless { topdir => $topdir, # xpfx => 'ei15' diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm index 2bb9afce..3e7f5604 100644 --- a/lib/PublicInbox/ExtSearchIdx.pm +++ b/lib/PublicInbox/ExtSearchIdx.pm @@ -30,6 +30,7 @@ use File::Spec; sub new { my (undef, $dir, $opt) = @_; + $dir = File::Spec->canonpath($dir); my $l = $opt->{indexlevel} // 'full'; $l !~ $PublicInbox::SearchIdx::INDEXLEVELS and die "invalid indexlevel=$l\n";