From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.4 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, RP_MATCHES_RCVD shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 64ECC1F71A for ; Sun, 6 Sep 2015 09:22:58 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] public-inbox-init: use absolute path Date: Sun, 6 Sep 2015 09:22:58 +0000 Message-Id: <20150906092258.31431-1-e@80x24.org> List-Id: We actually have no business expanding (e.g. translating ~ to $HOME) paths from the command-line argument, the shell does that. However, we need to make the path absolute instead. --- public-inbox-init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public-inbox-init b/public-inbox-init index 2d24402..a8f1dd7 100755 --- a/public-inbox-init +++ b/public-inbox-init @@ -8,7 +8,7 @@ use PublicInbox::Config; use File::Temp qw/tempfile/; use File::Basename qw/dirname/; use File::Path qw/mkpath/; -use File::Path::Expand qw/expand_filename/; +use Cwd qw/abs_path/; sub x { system(@_) and die join(' ', @_). " failed: $?\n" } sub usage { print STDERR "Usage: $usage\n"; exit 1 } @@ -59,7 +59,7 @@ close $fh or die "failed to close $filename: $!\n"; my $pfx = "publicinbox.$name"; my @x = (qw/git config/, "--file=$filename"); -$git_dir = expand_filename($git_dir); +$git_dir = abs_path($git_dir); x(qw(git init -q --bare), $git_dir); foreach my $addr (@address) { next if $seen{lc($addr)}; -- EW