Files
android
doc
m4
python
build
autotools.py
boost.py
dirs.py
download.py
ffmpeg.py
libs.py
project.py
tar.py
zlib.py
scripts
src
systemd
test
win32
.gitignore
AUTHORS
COPYING
INSTALL
Makefile.am
NEWS
README.md
autogen.sh
configure.ac
mpd.svg
valgrind.suppressions
mpd/python/build/tar.py

12 lines
332 B
Python

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