virtual-appliance/scripts/COPY
Albert Hopkins 5a96cc75a1 scripts: add COPY and RUN helpers.
Makes the Makefile easier to write and the output a little nicer.  Inspired
by a similar tool ;-)
2018-10-27 11:04:00 -07:00

19 lines
382 B
Python
Executable File

#!/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()