32 lines
748 B
Python
32 lines
748 B
Python
import os
|
|
import subprocess
|
|
|
|
PACKIE_EXEC = os.getenv("PACKIE", "packie")
|
|
|
|
|
|
def host_arch() -> str:
|
|
result = subprocess.run(
|
|
[PACKIE_EXEC, "print", "profile.host_arch"],
|
|
check=True,
|
|
capture_output=True,
|
|
)
|
|
return result.stdout.decode().strip()
|
|
|
|
|
|
def chroot_update(root: str):
|
|
subprocess.run([PACKIE_EXEC, "--chroot", root, "update"], check=True)
|
|
|
|
|
|
def chroot_install(root: str, requirements: list[str]):
|
|
subprocess.run(
|
|
[PACKIE_EXEC, "--chroot", root, "install", "--yes"] + requirements, check=True
|
|
)
|
|
|
|
|
|
def update():
|
|
subprocess.run([PACKIE_EXEC, "update"], check=True)
|
|
|
|
|
|
def install(requirements: list[str]):
|
|
subprocess.run([PACKIE_EXEC, "install", "--yes"] + requirements, check=True)
|