Support plbzip2.

This commit is contained in:
Bastian Kleineidam 2012-05-11 07:08:50 +02:00
parent f41259ad1a
commit 1cb76a9633
5 changed files with 38 additions and 4 deletions

View File

@ -6,6 +6,7 @@
Closes: SF bug #3351936
* Fix generating an RPM installer.
Closes: SF bug #2977749
* Added support for the lbzip2 program handling BZIP2 archives.
0.15 "Contraband" (released 8.4.2012)

View File

@ -69,7 +69,7 @@ ArchiveMimetypes = {
EncodingPrograms = {
'gzip': ('pigz', 'gzip'),
'bzip2': ('pbzip2', 'bzip2'),
'bzip2': ('pbzip2', 'lbzip2', 'bzip2'),
'compress': ('compress',),
'lzma': ('lzma',),
'xz': ('xz',),
@ -99,9 +99,9 @@ ArchivePrograms = {
'list': ('nomarch',),
},
'bzip2': {
'extract': ('pbzip2', 'bzip2', '7z', '7za'),
'test': ('pbzip2', 'bzip2', '7z', '7za'),
'create': ('pbzip2', 'bzip2', '7z', '7za'),
'extract': ('pbzip2', 'lbzip2', 'bzip2', '7z', '7za'),
'test': ('pbzip2', 'lbzip2', 'bzip2', '7z', '7za'),
'create': ('pbzip2', 'lbzip2', 'bzip2', '7z', '7za'),
'list': ('7z', '7za', 'echo',),
},
'tar': {

View File

@ -0,0 +1,18 @@
# -*- 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 <http://www.gnu.org/licenses/>.
"""Archive commands for the pbzip2 program."""
# bzip2 and lbzip2 are compatible
from patoolib.programs.bzip2 import extract_bzip2, test_bzip2, create_bzip2

View File

@ -110,6 +110,13 @@ class TestArchives (ArchiveTest):
self.archive_test('t .bz2')
self.archive_create('t .bz2', singlefile=True)
@needs_program('lbzip2')
def test_lbzip2 (self):
self.program = 'lbzip2'
self.archive_extract('t .bz2')
self.archive_test('t .bz2')
self.archive_create('t .bz2', singlefile=True)
@needs_program('echo')
def test_echo (self):
self.program = 'echo'

View File

@ -128,6 +128,14 @@ class TestArchives (ArchiveTest):
self.archive_test('t.bz2.foo')
self.archive_create('t.bz2.foo', format="bzip2", singlefile=True)
@needs_program('file')
@needs_program('lbzip2')
def test_lbzip2 (self):
self.program = 'lbzip2'
self.archive_extract('t.bz2.foo')
self.archive_test('t.bz2.foo')
self.archive_create('t.bz2.foo', format="bzip2", singlefile=True)
@needs_program('file')
@needs_program('echo')
def test_echo (self):