It's unsure whether python uses a hash based lookup for this or not,
so let's list the most commonly expected extensions first. Kernel
modules tend to be compressed these days, so those are the ones we
list first, with preference to zstd and xz.
def all_modules(modulesd: Path) -> Iterator[Path]:
# The glob may match additional paths.
# Narrow this down to *.ko, *.ko.gz, *.ko.xz, *.ko.zst.
- return (m for m in modulesd.rglob("*.ko*") if m.name.endswith((".ko", ".ko.gz", ".ko.xz", ".ko.zst")))
+ return (m for m in modulesd.rglob("*.ko*") if m.name.endswith((".ko.zst", ".ko.xz", ".ko.gz", ".ko")))
def globs_match_filename(name: str, globs: Sequence[str], *, match_default: bool = False) -> bool: