bugGNU Stow - Bugs: bug #64550, Unable to stow dot-dirs if target...

 
 

bug #64550: Unable to stow dot-dirs if target directory already exists

Submitter:  None
Submitted:  Sat 12 Aug 2023 05:14:26 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 12 Aug 2023 05:16:43 PM UTC, comment #1: 
Anonymous
Sat 12 Aug 2023 05:14:26 PM UTC, original submission:  

I'm hitting a bug where a .config dir in my repo cannot be stowed with --dotfiles.

In a directory have the following tree:

bug
bug/dot-config
bug/dot-config/some

In your target directory, the directory .config must exist.

The problem is that in stow_contents the SOURCE path is made up with the TARGET, this works when there isn't any rewriting done as is with --dotfiles. Suddenly the existence of .config is required.

I've added the patches to expose the bug in t/dotfiles.t and made some debugging lines in another commit.
Once 0001 is applied you can run the test to see the bug in action:

make all && prove -It -lv t/dotfiles.t for it to see.


Now run stow -S -v4 --dotfiles bug

This yields the following on your screen:

$ stow -S -v4 --dotfiles bug
stow dir is /home/wesleys/.dotty
stow dir path relative to target /home/wesleys is .dotty
cwd now /home/wesleys
cwd restored to /home/wesleys/.dotty
$VAR1 = [
          'bug'
        ];
cwd now /home/wesleys
Planning stow of package bug...
. not protected
Stowing contents of .dotty/bug (cwd=/home/wesleys)
  => .dotty/bug
  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
  Using built-in ignore list
  Adjusting: dot-config => .config
Stowing .dotty / bug / .config
  => .dotty/bug/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 .dotty/bug/.config (cwd=/home/wesleys)
  => ../.dotty/bug/dot-config
  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
$VAR1 = undef;
No path exists at .dotty/bug/.config at /usr/local/share/perl/5.36.0/Stow.pm line 396, <DATA> line 22.
Stow::stow_contents(Stow=HASH(0x55aa204bf8d8), ".dotty", "bug", ".config", "../.dotty/bug/dot-config") called at /usr/local/share/perl/5.36.0/Stow.pm line 544
Stow::stow_node(Stow=HASH(0x55aa204bf8d8), ".dotty", "bug", ".config", ".dotty/bug/dot-config") called at /usr/local/share/perl/5.36.0/Stow.pm line 422
Stow::stow_contents(Stow=HASH(0x55aa204bf8d8), ".dotty", "bug", ".", ".dotty/bug") called at /usr/local/share/perl/5.36.0/Stow.pm line 319
Stow::__ANON__(Stow=HASH(0x55aa204bf8d8)) called at /usr/local/share/perl/5.36.0/Stow.pm line 348
Stow::within_target_do(Stow=HASH(0x55aa204bf8d8), CODE(0x55aa204ee868)) called at /usr/local/share/perl/5.36.0/Stow.pm line 326
Stow::plan_stow(Stow=HASH(0x55aa204bf8d8), "bug") called at /usr/local/bin/stow line 478
main::main() called at /usr/local/bin/stow line 469

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #55030:  0001-Expose-bug-with-dotfiles-when-target-dir-already-exi.patch added by None (3KiB - text/x-patch - git format-patch patches)
file #55031:  0002-Debugging-Stow.pm-for-previous-commit.patch added by None (5KiB - text/x-patch - git format-patch patches)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2023-08-12 None Attached File- Added 0001-Expose-bug-with-dotfiles-when-target-dir-already-exi.patch, #55030
    Attached File- Added 0002-Debugging-Stow.pm-for-previous-commit.patch, #55031

Back to the top

Powered by Savane 3.13-4b48.
Corresponding source code