bug-stow
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-stow] stow doesn't ignore files when linking entire directory


From: Mario Finelli
Subject: [Bug-stow] stow doesn't ignore files when linking entire directory
Date: Tue, 26 Dec 2017 22:03:11 -0500

Apologies if this has already been reported, I searched the archives but
didn't find anything relevant.

Here's my system info:

address@hidden ~]$ stow -V
stow (GNU Stow) version 2.2.2
address@hidden ~]$ perl -v | sed -n 2p
This is perl 5, version 26, subversion 1 (v5.26.1) built for
x86_64-linux-thread-multi
address@hidden ~]$ uname -a
Linux stig 4.14.8-1-ARCH #1 SMP PREEMPT Wed Dec 20 21:27:44 UTC 2017
x86_64 GNU/Linux

The bug manifests when trying to ignore files in a sub-directory that
stow would like to link the entire directory. Instead of using the
ignore list and linking individual files Stow still links the entire
directory which causes unwanted files to be linked.

For example with the following project structure:

address@hidden .dotfiles]$ cat test/.stow-local-ignore
.*file2
address@hidden .dotfiles]$ ls test/test/
file1  file2

I would expect that running "stow test" that stow would create a
directory "test" and then link file1. What actually happens is that stow
links the entire directory:

address@hidden .dotfiles]$ stow -vvv test
stow dir is /home/mario/.dotfiles
stow dir path relative to target /home/mario is .dotfiles
cwd now /home/mario
cwd restored to /home/mario/.dotfiles
cwd now /home/mario
Planning stow of package test...
Stowing contents of .dotfiles/test (cwd=/home/mario)
Stowing .dotfiles / test / test
LINK: test => .dotfiles/test/test
Planning stow of package test... done
cwd restored to /home/mario/.dotfiles
Processing tasks...
cwd now /home/mario
cwd restored to /home/mario/.dotfiles
Processing tasks... done
address@hidden .dotfiles]$ ls ~/test
file1  file2

However, stow behaves correctly if the directory already exists:

address@hidden .dotfiles]$ stow -D test
address@hidden .dotfiles]$ mkdir ~/test
address@hidden .dotfiles]$ touch ~/test/file3
address@hidden .dotfiles]$ stow -vvv test
stow dir is /home/mario/.dotfiles
stow dir path relative to target /home/mario is .dotfiles
cwd now /home/mario
cwd restored to /home/mario/.dotfiles
cwd now /home/mario
Planning stow of package test...
Stowing contents of .dotfiles/test (cwd=/home/mario)
Stowing .dotfiles / test / test
Stowing contents of .dotfiles/test/test (cwd=/home/mario)
Stowing .dotfiles / test / test/file1
LINK: test/file1 => ../.dotfiles/test/test/file1
Planning stow of package test... done
cwd restored to /home/mario/.dotfiles
Processing tasks...
cwd now /home/mario
cwd restored to /home/mario/.dotfiles
Processing tasks... done
address@hidden .dotfiles]$ ls ~/test
file1  file3

In this case stow correctly links file1 and ignores file2.

Am I misusing stow here? Or am I correct that the behavior for this
use-case is wrong?

I'd be happy to provide more information or help in any way that I can.

Mario Finelli

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]