{android,win32}/build.py: move common code to python/build/

This commit is contained in:
Max Kellermann
2015-11-20 22:10:22 +01:00
parent 7dad662d69
commit 556f9ee39c
5 changed files with 66 additions and 104 deletions

11
python/build/tar.py Normal file

@@ -0,0 +1,11 @@
import os, shutil, subprocess
def untar(tarball_path, parent_path, base):
path = os.path.join(parent_path, base)
try:
shutil.rmtree(path)
except FileNotFoundError:
pass
os.makedirs(parent_path, exist_ok=True)
subprocess.check_call(['/bin/tar', 'xfC', tarball_path, parent_path])
return path