build/python/build/project.py: lazy tarball extraction

This commit is contained in:
Max Kellermann
2021-05-03 20:42:50 +02:00
parent a0f6932ebe
commit 52e4a4c904
2 changed files with 5 additions and 3 deletions
python/build

@@ -1,7 +1,9 @@
import os, shutil, subprocess
def untar(tarball_path, parent_path, base):
def untar(tarball_path, parent_path, base, lazy=False):
path = os.path.join(parent_path, base)
if lazy and os.path.isdir(path):
return path
try:
shutil.rmtree(path)
except FileNotFoundError: