#!/usr/bin/env python3 # Unpack a .tar.bz2 with Python, so the build doesn't need the bzip2 program. # Usage: untar.py TARBALL DEST_DIR import sys, tarfile with tarfile.open(sys.argv[1], "r:*") as t: if hasattr(tarfile, "data_filter"): t.extractall(sys.argv[2], filter="data") # refuse odd paths/devices else: t.extractall(sys.argv[2])