]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiInit.pm
No ext_urls
[public-inbox.git] / lib / PublicInbox / LeiInit.pm
index c6c0c01b1332e5694279b828d9c5e6f0e1852b44..27ce816901ef4bbb90ef6e9d860bc003d7581d31 100644 (file)
@@ -4,7 +4,6 @@
 # for the "lei init" command, not sure if it's even needed...
 package PublicInbox::LeiInit;
 use v5.10.1;
-use File::Spec;
 
 sub lei_init {
        my ($self, $dir) = @_;
@@ -13,7 +12,7 @@ sub lei_init {
        $dir //= $self->store_path;
        $dir = $self->rel2abs($dir);
        my @cur = stat($cur) if defined($cur);
-       $cur = File::Spec->canonpath($cur // $dir);
+       $cur = $self->canonpath_harder($cur // $dir);
        my @dir = stat($dir);
        my $exists = "# leistore.dir=$cur already initialized" if @dir;
        if (@cur) {
@@ -24,7 +23,7 @@ sub lei_init {
 
                # some folks like symlinks and bind mounts :P
                if (@dir && "@cur[1,0]" eq "@dir[1,0]") {
-                       $self->lei_config('leistore.dir', $dir);
+                       $self->_config('leistore.dir', $dir);
                        $self->_lei_store(1)->done;
                        return $self->qerr("$exists (as $cur)");
                }
@@ -32,7 +31,7 @@ sub lei_init {
 E: leistore.dir=$cur already initialized and it is not $dir
 
        }
-       $self->lei_config('leistore.dir', $dir);
+       $self->_config('leistore.dir', $dir);
        $self->_lei_store(1)->done;
        $exists //= "# leistore.dir=$dir newly initialized";
        $self->qerr($exists);