INNER CODE UNIT · Python

output

CyrilPeng/Venera-Next · .github/scripts/appimage_runtime.py:29

def output(*args, **kwargs):
    return subprocess.check_output(args, text=True, **kwargs)


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
    )]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…