Skip to content

Stowing a second package writes into the first package's source tree #20

Description

@arecarn

Stowing two packages that share a nested directory writes a link into the first package instead of the destination. The link dangles, and the second package’s file never appears in the destination.

Reproduce

mkdir -p a/pkg/x/y b/pkg/x/y dest
touch a/pkg/x/y/one b/pkg/x/y/two

dploy stow a/pkg dest
dploy stow b/pkg dest

Second command:

dploy stow: unlink dest/x => ../a/pkg/x
dploy stow: make directory dest/x
dploy stow: link dest/x/y => ../../a/pkg/x/y
dploy stow: link dest/x/y/two => ../../../b/pkg/x/y/two

The last link is made through dest/x/y, which is a symlink into a, so it lands in the source tree:

$ find dest
dest
dest/x
dest/x/y

$ find . -xtype l
./a/pkg/x/y/two        # dangling, and inside package a

Expected

dest/x/y/one and dest/x/y/two both resolve, and a/pkg is untouched.

Actual

a/pkg/x/y/two is created and dangles. dest has neither file reachable as two. A later dploy unstow b/pkg dest fails with ConflictsWithExistingLink.

Note

Unfolding dest/x is correct, but dest/x/y is then folded into a before b’s file is placed. Placement needs the whole path to the leaf unfolded, not just the first level.

Version: dploy 0.1.3, Python 3.14, Linux.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions