summaryrefslogtreecommitdiff
path: root/apply/resolv.py
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-04-25 20:12:25 +0200
committerJulian T <julian@jtle.dk>2021-04-25 20:12:25 +0200
commit7e93444f28a6790ab66fbdd8cc7eed9ca8970d48 (patch)
treefec5eb7eb328948d5c30d2e1d56e4c570d5dcc4c /apply/resolv.py
parent0c24ead1cb0126a1847c2ed971649e9ee25e920e (diff)
Add kind of working delete command
Diffstat (limited to 'apply/resolv.py')
-rw-r--r--apply/resolv.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/apply/resolv.py b/apply/resolv.py
index 93d0566..0073273 100644
--- a/apply/resolv.py
+++ b/apply/resolv.py
@@ -15,24 +15,24 @@ class Resolver:
self.override = override
self.state = state
- def check_parent(self, path: Path, packagename):
+ def check_parent(self, path: Path, modulename):
"""
Check if parents exists, and if we created them mark them
- with package name
+ with module name
"""
parent = path.parent
exists = parent.exists()
if (not exists) or parent in self.state.dirs:
- self.check_parent(parent, packagename)
+ self.check_parent(parent, modulename)
# Add to state
- self.state.add_dir(parent, packagename)
+ self.state.add_dir(parent, modulename)
if not exists:
self.writer.create_dir(parent)
- def do_link(self, package, ppath: Path):
+ def do_link(self, module, ppath: Path):
dest = Path(self.applydir, ppath)
dest_state = FileState.check_location(dest)
@@ -41,11 +41,11 @@ class Resolver:
raise Exception(f"Destination {ppath} already exists")
# Save the link in the statefile
- self.state.add_link(dest, package)
+ self.state.add_link(dest, module)
- self.check_parent(dest, package)
+ self.check_parent(dest, module)
- target_abs = Path.cwd().joinpath(Path(package, ppath))
+ target_abs = Path.cwd().joinpath(Path(module, ppath))
if dest_state == FileState.Owned and dest_state.link_intact()\
and dest_state.links_to() == target_abs:
return
@@ -54,6 +54,6 @@ class Resolver:
self.writer.delete(dest)
self.writer.create_link(target_abs, dest)
- def do_folder_link(self, package, ppath: Path) -> bool:
- self.do_link(package, ppath)
+ def do_folder_link(self, module, ppath: Path) -> bool:
+ self.do_link(module, ppath)
return True