aboutsummaryrefslogtreecommitdiffstats
path: root/jprov/overlay.py
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2026-02-16 12:59:14 +0200
committerJan Tuomi <jan@jantuomi.fi>2026-02-16 12:59:14 +0200
commit5f46fde558c467414fa151ad962caaf7f07628fa (patch)
tree247d6fd45ddbc811fb71d2009fbbd2042e158791 /jprov/overlay.py
Initial commit
Diffstat (limited to 'jprov/overlay.py')
-rw-r--r--jprov/overlay.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/jprov/overlay.py b/jprov/overlay.py
new file mode 100644
index 0000000..c2a04da
--- /dev/null
+++ b/jprov/overlay.py
@@ -0,0 +1,20 @@
+"""Overlay copy handling."""
+
+from __future__ import annotations
+
+import os
+import shutil
+
+
+def copy_overlay(src: str, dest_root: str) -> None:
+ if not src or not os.path.isdir(src):
+ return
+
+ for entry in os.listdir(src):
+ src_path = os.path.join(src, entry)
+ dest_path = os.path.join(dest_root, entry)
+ if os.path.isdir(src_path):
+ shutil.copytree(src_path, dest_path, symlinks=True, dirs_exist_ok=True)
+ else:
+ os.makedirs(os.path.dirname(dest_path), exist_ok=True)
+ shutil.copy2(src_path, dest_path, follow_symlinks=True)