[sdk/kde-builder] kde_builder_lib: refactor: Move check for blanked-out by branch-group to filter_out_unneeded_modules()

Andrew Shark <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit fed47f718eccfc72a951d38494082055f9e2fa1a by Andrew Shark.
Committed on 21/07/2026 at 19:46.
Pushed by ashark into branch 'master'.

refactor: Move check for blanked-out by branch-group to filter_out_unneeded_modules()

M  +0    -23   kde_builder_lib/application.py
M  +20   -2    kde_builder_lib/module_resolver.py

https://invent.kde.org/sdk/kde-builder/-/commit/fed47f718eccfc72a951d38494082055f9e2fa1a

diff --git a/kde_builder_lib/application.py b/kde_builder_lib/application.py
index 418dda40..37bc9ec1 100644
--- a/kde_builder_lib/application.py
+++ b/kde_builder_lib/application.py
@@ -283,32 +283,9 @@ class Application:
         if cmdline_selectors_len:
             modules = modules + module_resolver.resolve_selectors_into_modules(cmdline_selectors)
 
-        # Remove modules that are explicitly blanked out in their branch-group
-        # i.e. those modules where they *have* a branch-group, and it's set to
-        # be empty ("").
-        resolver = ctx.branch_group_resolver
         branch_group = ctx.get_option("branch-group")
         self._warn_if_branch_group_does_not_exists(branch_group)
 
-        filtered_modules: list[Module] = []
-        for module in modules:
-            if module.is_kde_project():
-                repopath = module.get_repopath()
-                branch = resolver.resolve_branch_group(repopath or module.name, branch_group)
-                if branch == "":  # Note that None means it was not mentioned, while "" means it was explicitly disabled
-                    printpath = repopath
-                    printpath = "y[" + printpath.replace("/", "]/y[") + "]"
-                    message = f" y[*] Removing {printpath} due to branch-group"
-                    if module.name in module_resolver.explicit_kdeproject_selectors:
-                        logger_app.warning(message)
-                    else:
-                        logger_app.debug(message)
-                    continue
-
-            filtered_modules.append(module)
-
-        modules = filtered_modules
-
         self._resolve_module_dependency_graph(modules)
 
         if "dependency-tree" in cmdline_global_options or "dependency-tree-fullpath" in cmdline_global_options:
diff --git a/kde_builder_lib/module_resolver.py b/kde_builder_lib/module_resolver.py
index 2b1048b7..34a9a777 100644
--- a/kde_builder_lib/module_resolver.py
+++ b/kde_builder_lib/module_resolver.py
@@ -325,8 +325,26 @@ class ModuleResolver:
                     # modules could not pass cmake configure.
                     logger_modres.warning(f" y[*] Removing y[third-party]/y[{module.name}] due to qt-install-dir")
                     continue
-            else:
-                filtered_modules.append(module)
+
+            if module.is_kde_project():
+                # Remove projects that are explicitly blanked out in their branch-group,
+                # i.e. those projects where they *have* a branch-group, and it's set to be empty ("").
+                ctx = self.context
+                resolver = ctx.branch_group_resolver
+                branch_group = ctx.get_option("branch-group")
+                repopath = module.get_repopath()
+                branch = resolver.resolve_branch_group(repopath, branch_group)
+                if branch == "":  # Note that None means it was not mentioned, while "" means it was explicitly disabled
+                    printpath = repopath
+                    printpath = "y[" + printpath.replace("/", "]/y[") + "]"
+                    message = f" y[*] Removing {printpath} due to branch-group"
+                    if module.name in self.explicit_kdeproject_selectors:
+                        logger_modres.warning(message)
+                    else:
+                        logger_modres.debug(message)
+                    continue
+
+            filtered_modules.append(module)
 
         return filtered_modules
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.