From 3c01a64a16a046a74b761676be79c02136a035d2 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Mon, 22 Feb 2010 18:22:49 +0100 Subject: [PATCH] Added support for lzma or xz encoded tar files (ie. t.tar.lzma and t.tar.xz) --- patoolib/programs/star.py | 3 +++ tests/test_archives.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/patoolib/programs/star.py b/patoolib/programs/star.py index e7ca5c9..5b3abbf 100644 --- a/patoolib/programs/star.py +++ b/patoolib/programs/star.py @@ -48,5 +48,8 @@ def add_star_opts (cmdlist, encoding, verbose): cmdlist.append('-Z') elif encoding == 'bzip2': cmdlist.append('-bz') + elif encoding in ('lzma', 'xz'): + # use compress-program option + cmdlist.append('compress-program=%s' % encoding) if verbose: cmdlist.append('-v') diff --git a/tests/test_archives.py b/tests/test_archives.py index 3b8eb7c..2d9348e 100644 --- a/tests/test_archives.py +++ b/tests/test_archives.py @@ -31,8 +31,8 @@ class TestArchives (ArchiveTest): self.archive_commands('t.tar.Z', cmd) self.archive_commands('t.tar.bz2', cmd) self.archive_commands('t.tbz2', cmd) - # XXXself.archive_commands('t.tar.lzma', cmd) - # XXXself.archive_command('t.tar.xz', cmd) + self.archive_commands('t.tar.lzma', cmd) + self.archive_commands('t.tar.xz', cmd) @needs_cmd('bzip2') def test_bzip2 (self):