diff options
author | jpakkane <jpakkane@gmail.com> | 2015-05-21 21:48:59 +0300 |
---|---|---|
committer | jpakkane <jpakkane@gmail.com> | 2015-05-21 21:48:59 +0300 |
commit | 49686c29f2b969bd2071920b4562856625f1304d (patch) | |
tree | a4c65bf91c0d7fe0dca9c203602230121561d9bd | |
parent | 776fc1ad55795542676995921be5ba506f903d0d (diff) | |
parent | 14de94ccd88bd7b7232da4a25364c1d9d8782387 (diff) | |
download | meson-49686c29f2b969bd2071920b4562856625f1304d.zip meson-49686c29f2b969bd2071920b4562856625f1304d.tar.gz meson-49686c29f2b969bd2071920b4562856625f1304d.tar.bz2 |
Merge pull request #127 from ignatenkobrain/untar_xz
add support for tar.xz file. Closes #126
-rw-r--r-- | wrap.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -15,6 +15,7 @@ import mlog import urllib.request, os, hashlib, shutil import subprocess +import sys class PackageDefinition: def __init__(self, fname): @@ -121,6 +122,13 @@ class Resolver: open(ofname, 'wb').write(srcdata) def extract_package(self, package): + if sys.version_info < (3, 5): + try: + import lzma + del lzma + shutil.register_unpack_format('xztar', ['.tar.xz', '.txz'], shutil._unpack_tarfile, [], "xz'ed tar-file") + except ImportError: + pass if os.path.isdir(os.path.join(self.subdir_root, package.get('directory'))): return shutil.unpack_archive(os.path.join(self.cachedir, package.get('source_filename')), self.subdir_root) |