INNER CODE UNIT · Python
extract_glibc_versions
alper-han/CrossMacro · scripts/ci/verify-glibc-baseline.py:24
def extract_glibc_versions(text: str) -> list[tuple[int, ...]]:
return sorted({parse_version(match) for match in GLIBC_VERSION_PATTERN.findall(text)})
def is_compatible(versions: list[tuple[int, ...]], maximum: tuple[int, ...]) -> bool:
return not versions or max(versions) <= maximum
def is_elf_file(path: Path) -> bool:
try:
with path.open("rb") as stream:
return stream.read(len(ELF_MAGIC)) == ELF_MAGIC
except OSError:
return False
def discover_elf_files(paths: list[Path]) -> list[Path]:
candidates: list[Path] = []