INNER CODE UNIT · Python
is_elf
CyrilPeng/Venera-Next · .github/scripts/appimage_runtime.py:33
def is_elf(path):
if not path.is_file():
return False
with path.open("rb") as stream:
return stream.read(4) == b"\x7fELF"
def parse_ldd(text):
if "=> not found" in text:
raise RuntimeError(f"Unresolved AppImage dependency:\n{text}")
return [Path(match.group(1)) for match in re.finditer(
r"(?:=>\s+|^\s*)(/[^\n]+?)\s+\(0x", text, re.M
)]
def dependencies(path, library_path):
result = subprocess.run(
["ldd", str(path)], text=True, capture_output=True,