[sdk/kde-builder] kde_builder_lib: refactor: Dismiss unnecessary Application.ignore_list attribute
Andrew Shark <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit f97374ba9c22e4f4cf3b8e0bd64507512176b2a8 by Andrew Shark.
Committed on 16/07/2026 at 21:51.
Pushed by ashark into branch 'master'.
refactor: Dismiss unnecessary Application.ignore_list attribute
`ignore_list` did store the ignored list from repo-metadata.
`ignored_selectors` stores the ignored list from cmdline and
from config global section.
The check against `ignored_selectors` items is going at near-end of
generate_module_list(). And the check against `ignore_list` items
was going right after that.
So I just combined all ignored items into `ignored_selectors`
and removed the extra check.
M +3 -19 kde_builder_lib/application.py
M +1 -2 kde_builder_lib/module_resolver.py
https://invent.kde.org/sdk/kde-builder/-/commit/f97374ba9c22e4f4cf3b8e0bd64507512176b2a8
diff --git a/kde_builder_lib/application.py b/kde_builder_lib/application.py
index a89c70f6..ce95fff6 100644
--- a/kde_builder_lib/application.py
+++ b/kde_builder_lib/application.py
@@ -67,15 +67,6 @@ class Application:
"""ModuleResolver object, that makes a new Module. See generate_module_list()."""
self._base_pid = os.getpid() # See finish()
- self.ignore_list: list[str] = []
- """
- List of KDE project paths to ignore completely.
-
- A list of KDE project paths to ignore, e.g. "sdk/kde-builder".
- Partial paths are acceptable, matches are determined by comparing the path provided to the suffix of the full path
- of modules being compared. See :meth:`KDEProjectsReader.project_path_matches_wildcard_search`.
- """
-
# Default to colorized output if sending to TTY
Debug().set_colorful_output(True if sys.stdout.isatty() else False)
@@ -228,8 +219,10 @@ class Application:
ignored_in_global_section.discard("") # do not place empty string element, there is a check with empty string element of module's module_set later (in post-expansion ignored-selectors check).
ctx.options["ignore-projects"] = []
+ ignored_in_metadata: set[str] = {item.rsplit("/", 1)[-1] for item in ctx.metadata.ignored_projects}
+
# For user convenience, cmdline ignored selectors would not override the config selectors. Instead, they will be merged.
- ignored_selectors: set[str] = ignored_in_cmdline | ignored_in_global_section
+ ignored_selectors: set[str] = ignored_in_cmdline | ignored_in_global_section | ignored_in_metadata
# After we read install-dir from config, we can check if we need to start program.
start_program_and_args: list[str] = opts["start-program"]
@@ -289,8 +282,6 @@ class Application:
if cmdline_selectors_len:
modules = modules + module_resolver.resolve_selectors_into_modules(cmdline_selectors)
- self.ignore_list = ctx.metadata.ignored_projects
-
# 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 ("").
@@ -372,17 +363,10 @@ class Application:
logger_app.debug(f"Project y[{module.name}] was removed due to being ignored.")
modules = filtered_modules
- # Filtering out modules that are set to be ignored in repo-metadata
filtered_modules: list[Module] = []
for module in modules:
- path = None
if module in filtered_modules:
logger_app.debug("Skipping duplicate project " + module.name)
- elif ((path := module.get_repopath() or module.name) and
- any(re.search(rf"(^|/){item}($|/)", path) for item in self.ignore_list)):
- # See if the name matches any given in the ignore list.
-
- logger_app.debug(f"Skipping ignored project {module}")
else:
logger_app.debug(f"Adding {module} to project list")
filtered_modules.append(module)
diff --git a/kde_builder_lib/module_resolver.py b/kde_builder_lib/module_resolver.py
index 4e28a135..04fd8af8 100644
--- a/kde_builder_lib/module_resolver.py
+++ b/kde_builder_lib/module_resolver.py
@@ -32,8 +32,7 @@ class ModuleResolver:
self.ignored_selectors: set[str] = set()
"""
- Declares all selectors that should be ignored by default in the process of expanding module sets.
- Any modules matching these selectors would be elided from any expanded module sets by default.
+ Holds selectors that should be ignored.
"""
self.cmdline_per_project_options = {}