#!/usr/bin/env python3 """Copy files from source to target in the chroot""" import os import subprocess import sys def main(): chroot = os.environ["CHROOT"] target = sys.argv[-1] chroot_target = os.path.join(chroot, target.lstrip('/')) command = ["cp"] + sys.argv[1:-1] + [chroot_target] subprocess.check_call(command) if __name__ == "__main__": main()