virtual-appliance/scripts/RUN
Albert Hopkins 23dcf91c29 scripts/RUN: don't use check_call
subprocess.check_call() raises an execption and produces an ugly Python
traceback on the console.  It's not really needed.  The cp command and
Makefile already give error output.  Instead we call sys.exit() with the
exit status of the cp command.
2018-12-02 00:04:26 -08:00

28 lines
625 B
Python
Executable File

#!/usr/bin/env python3
import os
import subprocess
import sys
def main():
environ = os.environ
command = [
"systemd-nspawn",
"--quiet",
f"--directory={environ['CHROOT']}",
f"--machine={environ['container']}",
f"--bind={environ['PORTAGE_DIR']}:/usr/portage",
f"--bind={environ['VA_PKGDIR']}:/usr/portage/packages",
f"--bind={environ['DISTDIR']}:/usr/portage/distfiles",
] + sys.argv[1:]
if os.environ.get("VA_ARCH") == "linux32":
command = ["linux32"] + command
sys.exit(subprocess.call(command))
if __name__ == "__main__":
main()