stages/untargz: add a stage to populate a tree from a tar.gz

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2019-06-12 19:20:15 +02:00
parent da121beda1
commit fc72b5cd03

12
stages/io.weldr.untargz Executable file
View file

@ -0,0 +1,12 @@
#!/usr/bin/python3
import json
import subprocess
import sys
def main(tree, input_dir, filename):
subprocess.run(["tar", "-xzf", f"{input_dir}/{filename}", "-C", tree], stdout=subprocess.DEVNULL, check=True)
if __name__ == '__main__':
options = json.load(sys.stdin)
sys.exit(main(**options))