From 76a13b3fa319e64a5827cf7641e6a4c2003cd305 Mon Sep 17 00:00:00 2001 From: Torsten Wierschin Date: Fri, 9 Oct 2026 12:57:26 +0000 Subject: [PATCH] Handle broken symlinks in release scope copy - Skip symlinks with non-existent targets (e.g., external/ArcGIS) - Prevents FileNotFoundError during package build Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- make_rpm_ubuntu26.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/make_rpm_ubuntu26.py b/make_rpm_ubuntu26.py index ba7ce51..3918c96 100755 --- a/make_rpm_ubuntu26.py +++ b/make_rpm_ubuntu26.py @@ -163,9 +163,14 @@ def copy_src_dir_to_dest_dir(srcdir, dstdir, perm=None, with_subdirs=True, relea if release_scope and rel_root == '.': if file not in release_items and not any(file == item.split('/')[0] for item in release_items if '/' in item): continue + src_path = os.path.join(root, file) + # Skip broken symlinks + if os.path.islink(src_path) and not os.path.exists(src_path): + debug(f"Skipping broken symlink: {src_path}") + continue if os.path.isfile(tmpdir) and os.path.exists(tmpdir): os.remove(tmpdir) - shutil.copy(os.path.join(root, file), tmpdir) + shutil.copy(src_path, tmpdir, follow_symlinks=True) if perm: f = os.path.join(tmpdir, file) add_perm = 0