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-ASN: X-Spam-Status: No, score=-4.1 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF 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 16706203C2 for ; Mon, 28 Nov 2022 05:32:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1669613568; bh=uCL+Ois8dtcQ7lebExB5OlpktwcJrRo6ryvK5qS27oA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DC+dPhivdQx7O+fK6ucmFHDQroFu97VFo1O+0HVjSktZwKyk7rfnWglT2yusLZ+oq 8SvvUcwb2rCzZkL7wcLOuxoZCgmEajZWd4V9j2LM2lcn1JuLJb9r6mjEpRXSlcXuTP rvf4GVpKR19ZFAbNYQyEwkgHZdJbuH7aIlnarsBI= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 72/95] clone: canonicalize destination path from CLI Date: Mon, 28 Nov 2022 05:32:09 +0000 Message-Id: <20221128053232.291618-73-e@80x24.org> In-Reply-To: <20221128053232.291618-1-e@80x24.org> References: <20221128053232.291618-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We'll probably save the destination path somewhere, so ensure the path doesn't have redundant slashes and such --- script/public-inbox-clone | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/public-inbox-clone b/script/public-inbox-clone index a11c6874..9a22fa21 100755 --- a/script/public-inbox-clone +++ b/script/public-inbox-clone @@ -37,6 +37,7 @@ defined($dst) or ($dst) = ($url =~ m!/([^/]+)/?\z!); index($dst, "\n") >= 0 and die "`\\n' not allowed in `$dst'"; # n.b. this is still a truckload of code... +require File::Spec; require PublicInbox::LEI; require PublicInbox::LeiExternal; require PublicInbox::LeiMirror; @@ -51,7 +52,7 @@ open $lei->{3}, '.' or die "open . $!"; my $mrr = bless { lei => $lei, src => $url, - dst => $dst, + dst => File::Spec->canonpath($dst), }, 'PublicInbox::LeiMirror'; $? = 0;