summaryrefslogtreecommitdiff
path: root/apply/resolv.py
diff options
context:
space:
mode:
Diffstat (limited to 'apply/resolv.py')
-rw-r--r--apply/resolv.py16
1 files changed, 2 insertions, 14 deletions
diff --git a/apply/resolv.py b/apply/resolv.py
index eba5ed1..93d0566 100644
--- a/apply/resolv.py
+++ b/apply/resolv.py
@@ -1,7 +1,6 @@
from pathlib import Path
from .writer import Writer
from .state import StateFile, FileState
-import os
class Resolver:
@@ -16,17 +15,6 @@ class Resolver:
self.override = override
self.state = state
- def check_location(self, path: Path) -> FileState:
- if not path.exists():
- return FileState.Unused
-
- if path.is_symlink():
- dest = Path(os.path.realpath(str(path)))
- if Path.cwd() in dest.parents:
- return FileState.create_owned(dest)
-
- return FileState.Used
-
def check_parent(self, path: Path, packagename):
"""
Check if parents exists, and if we created them mark them
@@ -46,7 +34,7 @@ class Resolver:
def do_link(self, package, ppath: Path):
dest = Path(self.applydir, ppath)
- dest_state = self.check_location(dest)
+ dest_state = FileState.check_location(dest)
if not self.override and not dest_state.can_write():
# Check if it's a pointer to the correct location
@@ -58,7 +46,7 @@ class Resolver:
self.check_parent(dest, package)
target_abs = Path.cwd().joinpath(Path(package, ppath))
- if dest_state == FileState.Owned \
+ if dest_state == FileState.Owned and dest_state.link_intact()\
and dest_state.links_to() == target_abs:
return