CmdRequiredOsPkg: Don't modify deps while iterating
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m51s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m34s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m40s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m39s
CI / Packaging test (push) Successful in 0s

--skip-excluded removed excluded modules from deps with
deps.remove() while iterating over deps. Removing an element
shifts the remaining elements to the left, so the loop skipped
the entry following each removed one, and consecutively
excluded modules survived the filter and leaked into the
output.

Build the filtered list with a comprehension instead.

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-09-08 22:21:36 +02:00
commit 2b951f7861
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -57,9 +57,7 @@ class CmdRequiredOsPkg(Cmd): # export
names_only = True,
)
if args.skip_excluded:
for d in deps:
if self.app.is_excluded_from_build(d) is not None:
deps.remove(d)
deps = [d for d in deps if self.app.is_excluded_from_build(d) is None]
subsecs = self.app.distro.os_cascade
log(DEBUG, 'subsecs = ', subsecs)
requires: set[str] = set()