From 165411a54a34aa9c3454878992ee50a43445fc72 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Sat, 23 Feb 2013 09:01:15 +0100 Subject: [PATCH] Fix rzip archive handling. --- doc/changelog.txt | 2 +- patoolib/programs/rzip.py | 12 +++++------- tests/archives/test_rzip.py | 4 ++-- tests/data/t.txt.rz | Bin 89 -> 88 bytes tests/data/t.txt.rz.foo | Bin 89 -> 88 bytes 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/doc/changelog.txt b/doc/changelog.txt index 610da98..ce3e0b3 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -2,7 +2,7 @@ * Add support for grepping in archive contents. * Fixed Python lzma archive handling. -* Fixed lzop and lrzip archive handling. +* Fixed lzop, lrzip and rzip archive handling. 0.19 "The Kids Are All Right" (released 21.2.2013) diff --git a/patoolib/programs/rzip.py b/patoolib/programs/rzip.py index 5f80a1a..cfb8c0a 100644 --- a/patoolib/programs/rzip.py +++ b/patoolib/programs/rzip.py @@ -13,23 +13,21 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -"""Archive commands for the lrzip program.""" +"""Archive commands for the rzip program.""" import os from .. import util def extract_rzip (archive, compression, cmd, **kwargs): - """Extract a RZIP archive.""" - # Since extracted files will be placed in the current directory, - # the cwd argument has to be the output directory. + """Extract an RZIP archive.""" cmdlist = [cmd, '-d', '-k'] if kwargs['verbose']: cmdlist.append('-v') outfile = util.get_single_outfile(kwargs['outdir'], archive) - cmdlist.extend(["-o", outfile, os.path.abspath(archive)]) - return (cmdlist, {'cwd': kwargs['outdir']}) + cmdlist.extend(["-o", outfile, archive]) + return cmdlist def create_rzip (archive, compression, cmd, *args, **kwargs): - """Create a RZIP archive.""" + """Create an RZIP archive.""" cmdlist = [cmd, '-k', '-o', archive] if kwargs['verbose']: cmdlist.append('-v') diff --git a/tests/archives/test_rzip.py b/tests/archives/test_rzip.py index 4a66490..691d011 100644 --- a/tests/archives/test_rzip.py +++ b/tests/archives/test_rzip.py @@ -22,10 +22,10 @@ class TestRzip (ArchiveTest): @needs_program(program) def test_rzip(self): - self.archive_extract('t.txt.rz') + self.archive_extract('t.txt.rz', check=Content.Singlefile) self.archive_create('t.txt.rz', check=Content.Singlefile) @needs_program(program) def test_rzip_file(self): - self.archive_extract('t.txt.rz.foo') + self.archive_extract('t.txt.rz.foo', check=Content.Singlefile) diff --git a/tests/data/t.txt.rz b/tests/data/t.txt.rz index e070832918082d44231f330afc9a575fec969014..7f2c097780a9c862d30792a077d8a0ee7eb1fbb9 100644 GIT binary patch delta 41 ocma!y;0lWJ3}9kpU|?XH$YmzM1Y|IjFZx@|3}S(KK-$Cz0FulF=Kufz delta 42 pcma!ukqk3}S(KK-$EJ3jmM+1$6)b diff --git a/tests/data/t.txt.rz.foo b/tests/data/t.txt.rz.foo index e070832918082d44231f330afc9a575fec969014..7f2c097780a9c862d30792a077d8a0ee7eb1fbb9 100644 GIT binary patch delta 41 ocma!y;0lWJ3}9kpU|?XH$YmzM1Y|IjFZx@|3}S(KK-$Cz0FulF=Kufz delta 42 pcma!ukqk3}S(KK-$EJ3jmM+1$6)b