Added support for clzip.
This commit is contained in:
parent
e0a661d7ae
commit
85f592b8ea
|
@ -2,6 +2,8 @@
|
|||
|
||||
* Fix command argument order when extracting cpio archives.
|
||||
* Added correct cpio MIME type on Debian systems.
|
||||
* Added support for the clzip program which is like lzip capable
|
||||
of handling LZIP (.lz) archives.
|
||||
|
||||
0.12 "Galaxy Quest" (released 20.11.2010)
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ EncodingPrograms = {
|
|||
'compress': ('compress',),
|
||||
'lzma': ('lzma',),
|
||||
'xz': ('xz',),
|
||||
'lzip': ('lzip',),
|
||||
'lzip': ('lzip', 'clzip'),
|
||||
}
|
||||
|
||||
# List of programs supporting the given archive format and command.
|
||||
|
@ -119,10 +119,10 @@ ArchivePrograms = {
|
|||
None: ('lha',),
|
||||
},
|
||||
'lzip': {
|
||||
'extract': ('lzip',),
|
||||
'list': ('echo',),
|
||||
'test': ('lzip',),
|
||||
'create': ('lzip',),
|
||||
'extract': ('lzip', 'clzip'),
|
||||
'list': ('echo', 'clzip'),
|
||||
'test': ('lzip', 'clzip'),
|
||||
'create': ('lzip', 'clzip'),
|
||||
},
|
||||
'lrzip': {
|
||||
'extract': ('lrzip',),
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) 2010 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 <http://www.gnu.org/licenses/>.
|
||||
"""Archive commands for the clzip 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
|
|
@ -45,6 +45,9 @@ class TestArchives (ArchiveTest):
|
|||
self.program = 'tar'
|
||||
self.archive_commands('t.tar.lzma')
|
||||
|
||||
# XXX even though clzip would support extracting .lz files, the
|
||||
# file(1) --uncompress command does not use it for achive detection
|
||||
@needs_program('lzip')
|
||||
@needs_codec('tar', 'lzip')
|
||||
def test_tar_lzip (self):
|
||||
self.program = 'tar'
|
||||
|
@ -311,6 +314,13 @@ class TestArchives (ArchiveTest):
|
|||
self.archive_extract('t.txt.lz')
|
||||
self.archive_create('t.txt.lz', singlefile=True)
|
||||
|
||||
@needs_program('clzip')
|
||||
def test_clzip (self):
|
||||
self.program = 'clzip'
|
||||
self.archive_test('t.txt.lz')
|
||||
self.archive_extract('t.txt.lz')
|
||||
self.archive_create('t.txt.lz', singlefile=True)
|
||||
|
||||
@needs_program('unalz')
|
||||
def test_unalz (self):
|
||||
self.program = 'unalz'
|
||||
|
|
|
@ -51,6 +51,9 @@ class TestArchives (ArchiveTest):
|
|||
# self.program = 'tar'
|
||||
# self.archive_commands('t.tar.lzma.foo', format="tar", encoding="lzma")
|
||||
|
||||
# XXX even though clzip would support extracting .lz files, the
|
||||
# file(1) --uncompress command does not use it for achive detection
|
||||
@needs_program('lzip')
|
||||
@needs_program('file')
|
||||
@needs_codec('tar', 'lzip')
|
||||
def test_tar_lzip (self):
|
||||
|
@ -350,6 +353,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('clzip')
|
||||
def test_clzip (self):
|
||||
self.program = 'clzip'
|
||||
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('xz')
|
||||
def test_xz (self):
|
||||
|
|
|
@ -83,8 +83,6 @@ class TestMime (unittest.TestCase):
|
|||
#self.mime_test_file("t.tar.lzma.foo", "application/x-tar", "lzma")
|
||||
self.mime_test_file("t.tar.xz", "application/x-tar", "xz")
|
||||
self.mime_test_file("t.tar.xz.foo", "application/x-tar", "xz")
|
||||
self.mime_test_file("t.tar.lz", "application/x-tar", "lzip")
|
||||
self.mime_test_file("t.tar.lz.foo", "application/x-tar", "lzip")
|
||||
self.mime_test_file("t.tar.Z", "application/x-tar", "compress")
|
||||
self.mime_test_file("t.tar.Z.foo", "application/x-tar", "compress")
|
||||
self.mime_test_file("t.taz", "application/x-tar", "gzip")
|
||||
|
@ -123,6 +121,12 @@ class TestMime (unittest.TestCase):
|
|||
self.mime_test_file("t.zoo", "application/x-zoo", None)
|
||||
self.mime_test_file("t.zoo.foo", "application/x-zoo", None)
|
||||
|
||||
@needs_program('file')
|
||||
@needs_program('lzip')
|
||||
def test_mime_file_lzip (self):
|
||||
self.mime_test_file("t.tar.lz", "application/x-tar", "lzip")
|
||||
self.mime_test_file("t.tar.lz.foo", "application/x-tar", "lzip")
|
||||
|
||||
def test_mime_mimedb (self):
|
||||
self.mime_test_mimedb("t .7z", "application/x-7z-compressed", None)
|
||||
self.mime_test_mimedb("t.arj", "application/x-arj", None)
|
||||
|
|
Loading…
Reference in New Issue