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