diff options
author | Julian T <julian@jtle.dk> | 2021-10-04 15:24:39 +0200 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2021-10-04 15:24:39 +0200 |
commit | 98d4650d53b1033956ec92c9f71d769d5b64ff5e (patch) | |
tree | 44e3f943a5a22b024eda59eb87536e34fbebff0b | |
parent | c9d3fd0cb71737c99de60e8eae6040974f88fc8e (diff) |
Fix: Detect owned links correctly
This fixes a bug where links pointer to other config file, would be
readded at each apply run.
This is because the link would be followed completely.
The command readlink only follows the symbolic link a single time.
-rw-r--r-- | apply/state.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apply/state.py b/apply/state.py index 9dafe9d..12440a6 100644 --- a/apply/state.py +++ b/apply/state.py @@ -55,7 +55,7 @@ class FileState(Enum): @staticmethod def check_location(path: Path) -> "FileState": if path.is_symlink(): - dest = Path(os.path.realpath(str(path))) + dest = Path(os.readlink(str(path))) if Path.cwd() in dest.parents: return FileState.create_owned(dest) |