diff --git a/doc/changelog.txt b/doc/changelog.txt index 7c00632..6b92765 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -7,6 +7,7 @@ * Fix generating an RPM installer. Closes: SF bug #2977749 * Added support for the lbzip2 program handling BZIP2 archives. +* Added support for the plzip program handling LZIP archives. 0.15 "Contraband" (released 8.4.2012) diff --git a/patoolib/__init__.py b/patoolib/__init__.py index 351601c..3c978b8 100644 --- a/patoolib/__init__.py +++ b/patoolib/__init__.py @@ -73,7 +73,7 @@ EncodingPrograms = { 'compress': ('compress',), 'lzma': ('lzma',), 'xz': ('xz',), - 'lzip': ('lzip', 'clzip', 'pdlzip'), + 'lzip': ('lzip', 'clzip', 'plzip', 'pdlzip'), } # List of programs supporting the given archive format and command. @@ -120,10 +120,10 @@ ArchivePrograms = { None: ('lha',), }, 'lzip': { - 'extract': ('lzip', 'clzip', 'pdlzip'), + 'extract': ('plzip', 'lzip', 'clzip', 'pdlzip'), 'list': ('echo',), - 'test': ('lzip', 'clzip', 'pdlzip'), - 'create': ('lzip', 'clzip', 'pdlzip'), + 'test': ('plzip', 'lzip', 'clzip', 'pdlzip'), + 'create': ('plzip', 'lzip', 'clzip', 'pdlzip'), }, 'lrzip': { 'extract': ('lrzip',), diff --git a/patoolib/programs/plzip.py b/patoolib/programs/plzip.py new file mode 100644 index 0000000..47f60d0 --- /dev/null +++ b/patoolib/programs/plzip.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2012 Bastian Kleineidam +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +"""Archive commands for the plzip program.""" +from patoolib.programs import extract_singlefile_standard, \ + test_singlefile_standard, create_singlefile_standard + + +extract_lzip = extract_singlefile_standard +test_lzip = test_singlefile_standard +create_lzip = create_singlefile_standard diff --git a/tests/test_archives.py b/tests/test_archives.py index 77846ef..77922c0 100644 --- a/tests/test_archives.py +++ b/tests/test_archives.py @@ -335,6 +335,13 @@ class TestArchives (ArchiveTest): self.archive_extract('t.txt.lz') self.archive_create('t.txt.lz', singlefile=True) + @needs_program('plzip') + def test_plzip (self): + self.program = 'plzip' + self.archive_test('t.txt.lz') + self.archive_extract('t.txt.lz') + self.archive_create('t.txt.lz', singlefile=True) + @needs_program('pdlzip') def test_pdlzip (self): self.program = 'pdlzip' diff --git a/tests/test_foo_archives.py b/tests/test_foo_archives.py index 8e3443b..d5ccb3e 100644 --- a/tests/test_foo_archives.py +++ b/tests/test_foo_archives.py @@ -371,6 +371,14 @@ class TestArchives (ArchiveTest): self.archive_extract('t.txt.lz.foo') self.archive_create('t.txt.lz.foo', format="lzip", singlefile=True) + @needs_program('file') + @needs_program('plzip') + def test_plzip (self): + self.program = 'plzip' + self.archive_test('t.txt.lz.foo') + self.archive_extract('t.txt.lz.foo') + self.archive_create('t.txt.lz.foo', format="lzip", singlefile=True) + @needs_program('file') @needs_program('pdlzip') def test_pdlzip (self):