From 98d4650d53b1033956ec92c9f71d769d5b64ff5e Mon Sep 17 00:00:00 2001 From: Julian T Date: Mon, 4 Oct 2021 15:24:39 +0200 Subject: 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. --- apply/state.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apply') 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) -- cgit v1.2.3