summaryrefslogtreecommitdiff
path: root/apply/state.py
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-10-04 15:24:39 +0200
committerJulian T <julian@jtle.dk>2021-10-04 15:24:39 +0200
commit98d4650d53b1033956ec92c9f71d769d5b64ff5e (patch)
tree44e3f943a5a22b024eda59eb87536e34fbebff0b /apply/state.py
parentc9d3fd0cb71737c99de60e8eae6040974f88fc8e (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.
Diffstat (limited to 'apply/state.py')
-rw-r--r--apply/state.py2
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)