From 5f46fde558c467414fa151ad962caaf7f07628fa Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Mon, 16 Feb 2026 12:59:14 +0200 Subject: Initial commit --- jprov/overlay.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 jprov/overlay.py (limited to 'jprov/overlay.py') 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) -- cgit v1.3