Menu

#8 Nested symlinks in source cause errors

v1.0.2
open
nobody
None
5
2019-05-05
2019-05-05
chrysn
No

In version 1.0.2, xstow errs out when installing packages that contain nested symlinks outside their package directory:

$ tree
.
├── a-data/
│   └── common-2 -> ../a-data-2/
├── a-data-2/
│   └── from-a
├── farm/
├── source-a/
│   └── common -> ../a-data/
└── source-b/
    └── common/
        └── common-2/
            └── from-b

9 directories, 2 files
$ xstow -t farm source-a
$ xstow -t farm source-b
unknown file type farm/a-data-2
xstow: unknown file type farm/a-data-2
xstow: Error: unknown Exception caught

When the stowings happen in the reverse order, a correct farm is built:

$ tree farm
farm
└── common/
    └── common-2/
        ├── from-a -> ../../../source-a/common/common-2/from-a
        └── from-b -> ../../../source-b/common/common-2/from-b

2 directories, 2 files

In a non-minimal setup, the issue has manifested not in "unknown file type" + exception errors, but in "path X is not part of an xstow managed package", where X was a nonexistant path constructed by resolving some relative symlink not from its actual location but from the location it was accessed on (if the example above were conducted in /tmp/test/, X could be something like /tmp/a-data-2, which no link actually points to).

While such situations are rare in software installations, they can easily happen when using xstow to manage data unions (eg. see https://unix.stackexchange.com/questions/179397/create-symlink-tree-in-existing-directories#179404).

Discussion


Log in to post a comment.

MongoDB Logo MongoDB