From 49500eaf3ae0f590b257636c66f87dfe377d13d2 Mon Sep 17 00:00:00 2001 From: Torsten Wierschin Date: Fri, 9 Oct 2026 18:23:45 +0000 Subject: [PATCH] Fix directory filtering for Lts/Proxies/TrainingAreaBase in release scope - Refactored should_keep_dir logic to properly handle multi-level paths - Lts/Proxies directory was being filtered out at root level before reaching Lts/Proxies check - Added helper function to check if directory is part of a path leading to release items - Re-added Z directory filtering that was accidentally removed Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- make_rpm_ubuntu26.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/make_rpm_ubuntu26.py b/make_rpm_ubuntu26.py index f368134..9d191d9 100755 --- a/make_rpm_ubuntu26.py +++ b/make_rpm_ubuntu26.py @@ -135,7 +135,19 @@ def copy_src_dir_to_dest_dir(srcdir, dstdir, perm=None, with_subdirs=True, relea rel_root = os.path.relpath(root, srcdir) if rel_root == '.': # At root level, only keep release scope directories - dirs[:] = [d for d in dirs if d in release_items or any(d == item.split('/')[0] for item in release_items if '/' in item)] + # Need to handle multi-level paths like 'Lts/Proxies/TrainingAreaBase' + def should_keep_dir(d): + # Check if directory is directly in release_items + if d in release_items: + return True + # Check if directory is the first part of a multi-level release item + for item in release_items: + if '/' in item: + first_part = item.split('/')[0] + if d == first_part: + return True + return False + dirs[:] = [d for d in dirs if should_keep_dir(d)] elif rel_root == 'Z': # In Z directory, only keep src dirs[:] = [d for d in dirs if d == 'src']