INNER CODE UNIT · Python

discover_elf_files

alper-han/CrossMacro · scripts/ci/verify-glibc-baseline.py:40

def discover_elf_files(paths: list[Path]) -> list[Path]:
    candidates: list[Path] = []
    for path in paths:
        if path.is_dir():
            candidates.extend(candidate for candidate in path.rglob("*") if candidate.is_file())
        elif path.is_file():
            candidates.append(path)

    return sorted({candidate for candidate in candidates if is_elf_file(candidate)})


def expand_inputs(paths: list[Path]) -> list[Path]:
    expanded: list[Path] = []
    for path in paths:
        if path.is_dir():
            discovered = discover_elf_files([path])
            if not discovered:
                raise RuntimeError(f"directory contains no ELF files: {path}")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…