Probably a --dotfiles bug?

dunklecat <[email protected]> Tue, 19 May 2020 12:23:48 +0200
Newsgroups gmane.comp.gnu.stow.bugs
Message-ID <[email protected]>
--=-1c83XBKpTKShi0sBJhvI
Content-Type: text/plain; charset=us-ascii; format=flowed

 > stow --version
stow (GNU Stow) version 2.3.1

 > perl -v

This is perl 5, version 30, subversion 1 (v5.30.1) built for 
x86_64-linux-thread-multi

Copyright 1987-2019, Larry Wall

Perl may be copied only under the terms of either the Artistic License 
or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to 
the
Internet, point your browser at <http://www.perl.org/>, the Perl Home 
Page.

 > uname -a
Linux nxs 5.4.41 #1-NixOS SMP Thu May 14 05:58:30 UTC 2020 x86_64 
GNU/Linux

 > Description of the problem
I'm using the --dotfiles option that should transform dot- prefix to .. 
As an example dot-config is transformed into .config.

However if I use it and the directory already exists it throws an error
stow: ERROR: stow_contents() called with non-directory path: 
dotfiles/nvim/.config

In this example I'm trying to use dotfiles/nvim/dot-config/stuff. It 
works flawlessy using .config instead.

Both with ~/.config/nvim directory non-existent and ~/.config already 
there

With dotfiles/nvim/dot-config/nvim/init.vim

 > stow --dotfiles --verbose=3 nvim
stow dir is /home/dunklecat/dotfiles
stow dir path relative to target /home/dunklecat is dotfiles
cwd now /home/dunklecat
cwd restored to /home/dunklecat/dotfiles
cwd now /home/dunklecat
Planning stow of package nvim...
Stowing contents of dotfiles/nvim (cwd=/home/dunklecat)
Stowing dotfiles / nvim / .config
Stowing contents of dotfiles/nvim/.config (cwd=/home/dunklecat)
stow: ERROR: stow_contents() called with non-directory path: 
dotfiles/nvim/.config

With dotfiles/nvim/.config/nvim/init.vim

 > stow --dotfiles --verbose=3 nvim
(--dotfiles ignores all the directories that hasn't dot- as a prefix)
stow dir is /home/dunklecat/dotfiles
stow dir path relative to target /home/dunklecat is dotfiles
cwd now /home/dunklecat
cwd restored to /home/dunklecat/dotfiles
cwd now /home/dunklecat
Planning stow of package nvim...
Stowing contents of dotfiles/nvim (cwd=/home/dunklecat)
Stowing dotfiles / nvim / .config
Stowing contents of dotfiles/nvim/.config (cwd=/home/dunklecat)
Stowing dotfiles / nvim / .config/nvim
LINK: .config/nvim => ../dotfiles/nvim/.config/nvim
Planning stow of package nvim... done
cwd restored to /home/dunklecat/dotfiles
Processing tasks...
cwd now /home/dunklecat
cwd restored to /home/dunklecat/dotfiles
Processing tasks... done

I expected to get the same output in both situations


--=-1c83XBKpTKShi0sBJhvI
Content-Type: text/html; charset=us-ascii

<div id="geary-body" dir="auto"><div><div>&gt; stow --version &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>stow (GNU Stow) version 2.3.1</div></div><div><br></div><div><div>&gt; perl -v &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div><br></div><div>This is perl 5, version 30, subversion 1 (v5.30.1) built for x86_64-linux-thread-multi</div><div><br></div><div>Copyright 1987-2019, Larry Wall</div><div><br></div><div>Perl may be copied only under the terms of either the Artistic License or the</div><div>GNU General Public License, which may be found in the Perl 5 source kit.</div><div><br></div><div>Complete documentation for Perl, including FAQ lists, should be found on</div><div>this system using "man perl" or "perldoc perl". &nbsp;If you have access to
  the</div><div>Internet, point your browser at <a href="http://www.perl.org/">http://www.perl.org/</a>, the Perl Home Page.</div><div><br></div></div><div>&gt; uname -a</div><div><div>Linux nxs 5.4.
 41 #1-NixOS SMP Thu May 14 05:58:30 UTC 2020 x86_64 GNU/Linux</div></div><div><br></div><div>&gt; Description of the problem</div><div><div>I'm using the --dotfiles option that should transform dot- prefix to .. As an example dot-config is transformed into .config.&nbsp;</div><div><br></div><div>However if I use it and the directory already exists it throws an error&nbsp;</div><div>stow: ERROR: stow_contents() called with non-directory path: dotfiles/nvim/.config&nbsp;</div><div><br></div><div>In this example I'm trying to use dotfiles/nvim/dot-config/stuff. It works flawlessy using .config instead.</div><div><br></div><div>Both with ~/.config/nvim directory non-existent and ~/.config already there</div><div><br></div><div>With dotfiles/nvim/dot-config/nvim/init.vim</div><div><br></div><d
 iv>&gt; stow --dotfiles --verbose=3 nvim</div><div>stow dir is /home/dunklecat/dotfiles</div><div>stow dir path relative to target /home/dunklecat is dotfiles</div><div>cwd now /home/dunklecat</div>
 <div>cwd restored to /home/dunklecat/dotfiles</div><div>cwd now /home/dunklecat</div><div>Planning stow of package nvim...</div><div>Stowing contents of dotfiles/nvim (cwd=/home/dunklecat)</div><div>Stowing dotfiles / nvim / .config</div><div>Stowing contents of dotfiles/nvim/.config (cwd=/home/dunklecat)</div><div>stow: ERROR: stow_contents() called with non-directory path: dotfiles/nvim/.config</div><div><br></div><div>With dotfiles/nvim/.config/nvim/init.vim</div><div><br></div><div>&gt; stow --dotfiles --verbose=3 nvim&nbsp;</div><div>(--dotfiles ignores all the directories that hasn't dot- as a prefix)</div><div>stow dir is /home/dunklecat/dotfiles</div><div>stow dir path relative to target /home/dunklecat is dotfiles</div><div>cwd now /home/dunklecat</div><div>cwd restored to /home/
 dunklecat/dotfiles</div><div>cwd now /home/dunklecat</div><div>Planning stow of package nvim...</div><div>Stowing contents of dotfiles/nvim (cwd=/home/dunklecat)</div><div>Stowing dotfiles / nvim / 
 .config</div><div>Stowing contents of dotfiles/nvim/.config (cwd=/home/dunklecat)</div><div>Stowing dotfiles / nvim / .config/nvim</div><div>LINK: .config/nvim =&gt; ../dotfiles/nvim/.config/nvim</div><div>Planning stow of package nvim... done</div><div>cwd restored to /home/dunklecat/dotfiles</div><div>Processing tasks...</div><div>cwd now /home/dunklecat</div><div>cwd restored to /home/dunklecat/dotfiles</div><div>Processing tasks... done</div></div><div><br></div><div>I expected to get the same output in both situations</div></div>
--=-1c83XBKpTKShi0sBJhvI--