Add VHD support with 7z

This commit is contained in:
Bastian Kleineidam 2015-12-10 20:14:53 +01:00
parent 02004743f7
commit a2e096ae98
8 changed files with 26 additions and 7 deletions

View File

@ -1,3 +1,8 @@
1.10 (released xx.xx.2015)
* Added support for VHD (Virtual Hard Disk) archives with 7z.
1.9 (released 07.12.2015) 1.9 (released 07.12.2015)
* Fix ZPAQ archive creation. * Fix ZPAQ archive creation.

View File

@ -36,7 +36,7 @@ ArchiveFormats = (
'7z', 'ace', 'adf', 'alzip', 'ape', 'ar', 'arc', 'arj', '7z', 'ace', 'adf', 'alzip', 'ape', 'ar', 'arc', 'arj',
'bzip2', 'cab', 'chm', 'compress', 'cpio', 'deb', 'dms', 'bzip2', 'cab', 'chm', 'compress', 'cpio', 'deb', 'dms',
'flac', 'gzip', 'iso', 'lrzip', 'lzh', 'lzip', 'lzma', 'lzop', 'flac', 'gzip', 'iso', 'lrzip', 'lzh', 'lzip', 'lzma', 'lzop',
'rar', 'rpm', 'rzip', 'shar', 'shn', 'tar', 'xz', 'rar', 'rpm', 'rzip', 'shar', 'shn', 'tar', 'vhd', 'xz',
'zip', 'zoo', 'zpaq') 'zip', 'zoo', 'zpaq')
# Supported compressions (used with tar for example) # Supported compressions (used with tar for example)
@ -77,6 +77,7 @@ ArchiveMimetypes = {
'application/x-rzip': 'rzip', 'application/x-rzip': 'rzip',
'application/x-shar': 'shar', 'application/x-shar': 'shar',
'application/x-tar': 'tar', 'application/x-tar': 'tar',
'application/x-vhd': 'vhd',
'application/x-xz': 'xz', 'application/x-xz': 'xz',
'application/x-zip-compressed': 'zip', 'application/x-zip-compressed': 'zip',
'application/x-zoo': 'zoo', 'application/x-zoo': 'zoo',
@ -225,6 +226,11 @@ ArchivePrograms = {
'list': ('dpkg-deb', '7z'), 'list': ('dpkg-deb', '7z'),
'test': ('dpkg-deb', '7z'), 'test': ('dpkg-deb', '7z'),
}, },
'dms': {
'extract': ('xdms',),
'list': ('xdms',),
'test': ('xdms',),
},
'lzop': { 'lzop': {
None: ('lzop',), None: ('lzop',),
}, },
@ -248,6 +254,11 @@ ArchivePrograms = {
'list': ('py_echo',), 'list': ('py_echo',),
'create': ('shorten',), 'create': ('shorten',),
}, },
'vhd': {
'extract': ('7z',),
'list': ('7z',),
'test': ('7z',),
},
'xz': { 'xz': {
None: ('xz', '7z'), None: ('xz', '7z'),
'extract': py_lzma, 'extract': py_lzma,
@ -259,11 +270,6 @@ ArchivePrograms = {
'zpaq': { 'zpaq': {
None: ('zpaq',), None: ('zpaq',),
}, },
'dms': {
'extract': ('xdms',),
'list': ('xdms',),
'test': ('xdms',),
},
} }
# List those programs that have different python module names because of # List those programs that have different python module names because of

View File

@ -48,6 +48,7 @@ extract_zip = \
extract_rpm = \ extract_rpm = \
extract_deb = \ extract_deb = \
extract_iso = \ extract_iso = \
extract_vhd = \
extract_7z extract_7z
def list_7z (archive, compression, cmd, verbosity, interactive): def list_7z (archive, compression, cmd, verbosity, interactive):
@ -71,6 +72,7 @@ list_bzip2 = \
list_iso = \ list_iso = \
list_xz = \ list_xz = \
list_lzma = \ list_lzma = \
list_vhd = \
list_7z list_7z
@ -95,6 +97,7 @@ test_bzip2 = \
test_iso = \ test_iso = \
test_xz = \ test_xz = \
test_lzma = \ test_lzma = \
test_vhd = \
test_7z test_7z

View File

@ -125,6 +125,7 @@ def add_mimedb_data(mimedb):
add_mimetype(mimedb, 'application/x-dms', '.dms') add_mimetype(mimedb, 'application/x-dms', '.dms')
add_mimetype(mimedb, 'application/x-zip-compressed', '.crx') add_mimetype(mimedb, 'application/x-zip-compressed', '.crx')
add_mimetype(mimedb, 'application/x-shar', '.shar') add_mimetype(mimedb, 'application/x-shar', '.shar')
add_mimetype(mimedb, 'application/x-vhd', '.vhd')
add_mimetype(mimedb, 'audio/x-ape', '.ape') add_mimetype(mimedb, 'audio/x-ape', '.ape')
add_mimetype(mimedb, 'audio/x-shn', '.shn') add_mimetype(mimedb, 'audio/x-shn', '.shn')
add_mimetype(mimedb, 'audio/flac', '.flac') add_mimetype(mimedb, 'audio/flac', '.flac')

View File

@ -33,7 +33,7 @@ from distutils import util
from distutils.file_util import write_file from distutils.file_util import write_file
AppName = "patool" AppName = "patool"
AppVersion = "1.9" AppVersion = "1.10"
MyName = "Bastian Kleineidam" MyName = "Bastian Kleineidam"
MyEmail = "bastian.kleineidam@web.de" MyEmail = "bastian.kleineidam@web.de"

View File

@ -36,6 +36,7 @@ class Test7z (ArchiveTest):
self.archive_list('t.rpm') self.archive_list('t.rpm')
self.archive_list('t.deb') self.archive_list('t.deb')
self.archive_list('t.iso') self.archive_list('t.iso')
self.archive_list('t.vhd')
self.archive_extract('t.txt.gz', check=Content.Singlefile) self.archive_extract('t.txt.gz', check=Content.Singlefile)
self.archive_extract('t.txt.bz2', check=Content.Singlefile) self.archive_extract('t.txt.bz2', check=Content.Singlefile)
self.archive_extract('t.txt.lzma', check=Content.Singlefile) self.archive_extract('t.txt.lzma', check=Content.Singlefile)
@ -47,6 +48,7 @@ class Test7z (ArchiveTest):
self.archive_extract('t.rpm', check=None) self.archive_extract('t.rpm', check=None)
self.archive_extract('t.deb', check=None) self.archive_extract('t.deb', check=None)
self.archive_extract('t.iso') self.archive_extract('t.iso')
self.archive_extract('t.vhd', check=None)
self.archive_test('t.txt.gz') self.archive_test('t.txt.gz')
self.archive_test('t.txt.bz2') self.archive_test('t.txt.bz2')
self.archive_test('t.txt.lzma') self.archive_test('t.txt.lzma')
@ -58,6 +60,7 @@ class Test7z (ArchiveTest):
self.archive_test('t.rpm') self.archive_test('t.rpm')
self.archive_test('t.deb') self.archive_test('t.deb')
self.archive_test('t.iso') self.archive_test('t.iso')
self.archive_test('t.vhd')
self.archive_create('t.txt.gz', check=Content.Singlefile) self.archive_create('t.txt.gz', check=Content.Singlefile)
self.archive_create('t.txt.bz2', check=Content.Singlefile) self.archive_create('t.txt.bz2', check=Content.Singlefile)

BIN
tests/data/t.vhd Normal file

Binary file not shown.

View File

@ -205,4 +205,5 @@ class TestMime (unittest.TestCase):
self.mime_test_mimedb("t.iso", "application/x-iso9660-image") self.mime_test_mimedb("t.iso", "application/x-iso9660-image")
self.mime_test_mimedb("t.epub", "application/zip") self.mime_test_mimedb("t.epub", "application/zip")
self.mime_test_mimedb("t.apk", "application/zip") self.mime_test_mimedb("t.apk", "application/zip")
self.mime_test_mimedb("t.vhd", "application/x-vhd")
self.mime_test_mimedb("t.zpaq", "application/zpaq") self.mime_test_mimedb("t.zpaq", "application/zpaq")