tools: idf_tools.py: add support for .tar.xz archives

pull/7680/head
Ivan Grokhotkov 2021-09-10 13:23:00 +02:00
rodzic 59f6087b55
commit 57a32a8615
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -295,6 +295,8 @@ def unpack(filename, destination): # type: (str, str) -> None
info('Extracting {0} to {1}'.format(filename, destination))
if filename.endswith(('.tar.gz', '.tgz')):
archive_obj = tarfile.open(filename, 'r:gz') # type: Union[TarFile, ZipFile]
elif filename.endswith(('.tar.xz')):
archive_obj = tarfile.open(filename, 'r:xz')
elif filename.endswith('zip'):
archive_obj = ZipFile(filename)
else: