diff --git a/patoolib/__init__.py b/patoolib/__init__.py index f96ac97..8eb9410 100644 --- a/patoolib/__init__.py +++ b/patoolib/__init__.py @@ -244,7 +244,7 @@ ArchivePrograms = { 'create': ('shorten',), }, 'xz': { - None: ('xz',), + None: ('xz', '7z'), 'extract': py_lzma, 'create': py_lzma, }, diff --git a/patoolib/programs/p7zip.py b/patoolib/programs/p7zip.py index e6bfadb..d087344 100644 --- a/patoolib/programs/p7zip.py +++ b/patoolib/programs/p7zip.py @@ -30,6 +30,7 @@ extract_bzip2 = \ extract_rpm = \ extract_deb = \ extract_iso = \ + extract_xz = \ extract_7z def list_7z (archive, compression, cmd, verbosity): @@ -47,6 +48,7 @@ list_bzip2 = \ list_rpm = \ list_deb = \ list_iso = \ + list_xz = \ list_7z @@ -65,6 +67,7 @@ test_bzip2 = \ test_rpm = \ test_deb = \ test_iso = \ + test_xz = \ test_7z @@ -75,4 +78,5 @@ def create_7z (archive, compression, cmd, verbosity, filenames): return cmdlist create_zip = \ + create_xz = \ create_7z diff --git a/tests/archives/test_7z.py b/tests/archives/test_7z.py index 6069180..e42c9eb 100644 --- a/tests/archives/test_7z.py +++ b/tests/archives/test_7z.py @@ -24,6 +24,7 @@ class Test7z (ArchiveTest): def test_7z (self): self.archive_commands('t .7z') self.archive_commands('t.zip') + self.archive_commands('t.txt.xz', check=Content.Singlefile) self.archive_list('t.txt.gz') self.archive_list('t.txt.bz2') self.archive_list('t.jar') @@ -67,6 +68,7 @@ class Test7z (ArchiveTest): def test_7z_file (self): self.archive_commands('t.7z.foo', skip_create=True) self.archive_commands('t.zip.foo', skip_create=True) + self.archive_commands('t.txt.xz.foo', skip_create=True, check=Content.Singlefile) self.archive_list('t.txt.gz.foo') self.archive_list('t.txt.bz2.foo') self.archive_list('t.jar.foo') @@ -105,4 +107,3 @@ class Test7z (ArchiveTest): self.archive_list('t.rar.foo') self.archive_extract('t.rar.foo') self.archive_test('t.rar.foo') -