#941940 stow: --dotfiles option creates a broken symlink if a directory in the package starts with 'dot-' when an equivalent directory (which starts with '.') exists in the target directory

Package:
stow
Source:
stow
Submitter:
Daniel Semyonov
Date:
2024-03-03 14:54:04 UTC
Severity:
normal
Tags:
#941940#5
Date:
2019-10-07 19:27:58 UTC
From:
To:
Dear Maintainer,

I wanted to test out the --dotfiles option after reading about it in the stow
patch notes, so I renamed the top directory in my 'beets' package from
'.config' to 'dot-config'.
I ran the command 'stow -t ~ --dotfiles beets' under my user in the directory
in which the beets package is located (~/Documents/Configurations/).
The output was 'stow: ERROR: stow_contents() called with non-directory path:
Documents/Configurations/beets/.config'.
Note: the '~/.config' directory existed prior to this test.
The output with -v 5:

stow dir is /home/daniel/Documents/Configurations
stow dir path relative to target /home/daniel is Documents/Configurations
cwd now /home/daniel
cwd restored to /home/daniel/Documents/Configurations
cwd now /home/daniel
Planning stow of package beets...
. not protected
Stowing contents of Documents/Configurations/beets (cwd=/home/daniel)
  => Documents/Configurations/beets
  is_a_node(.)
  link_task_action(.): no task
  dir_task_action(.): no task
    parent_link_scheduled_for_removal(.): prefix
    parent_link_scheduled_for_removal(.): returning false
  is_a_node(.): really exists
  Documents/Configurations/beets/.stow-local-ignore didn't exist
  /home/daniel/.stow-global-ignore didn't exist
  Using built-in ignore list
    Ignore list regexp for paths:
/(?^:(^|/)(^/README.*|^/COPYING|^/LICENSE.*|^/\.stow\-local\-ignore$)(/|$))/
    Ignore list regexp for segments:
/(?^:^(\.svn|\.git|.+,v|.+~|CVS|\.cvsignore|\.hg|\.gitignore|\.#.+|RCS|_darcs|#.*#)$)/
  Not ignoring dot-config
  Adjusting: dot-config => .config
Stowing Documents/Configurations / beets / .config
  => Documents/Configurations/beets/dot-config
  is_a_link(.config)
  link_task_action(.config): no task
  is_a_link(.config): returning 0
  is_a_node(.config)
  link_task_action(.config): no task
  dir_task_action(.config): no task
    parent_link_scheduled_for_removal(.config): prefix .config
    parent_link_scheduled_for_removal(.config): returning false
  is_a_node(.config): really exists
  Evaluate existing node: .config
  is_a_dir(.config)
  dir_task_action(.config): no task
    parent_link_scheduled_for_removal(.config): prefix .config
    parent_link_scheduled_for_removal(.config): returning false
  is_a_dir(.config): real dir
.config not protected
Stowing contents of Documents/Configurations/beets/.config (cwd=/home/daniel)
  => ../Documents/Configurations/beets/dot-config
stow: ERROR: stow_contents() called with non-directory path:
Documents/Configurations/beets/.config

I checked the ~/.config/beets directory and found out it was a broken symlink
pointing to '~/Documents/Configurations/beets/.config/beets' instead of
'~/Documents/Configurations/beets/dot-config/beets'.
I decided to test if the --dotfiles options is broken in general or just for
this specific case so I renamed the 'dot-config' directory to 'dot-config-
test'.
Running the original command in this case was successful, creating a symlink
'~/.config-test' to '~/Documents/Configurations/beets/dot-config-test' as
expected.

I hope I provided all the required information, this is my first time reporting
a bug for a Debian package.

#941940#10
Date:
2024-03-03 14:51:43 UTC
From:
To:
Empty Message