Skip to content

Commit

Permalink
Added UDF support with 7z
Browse files Browse the repository at this point in the history
  • Loading branch information
wummel committed Nov 9, 2024
1 parent 2561095 commit c129b47
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ APE (.ape), AR (.a), ARC (.arc), ARJ (.arj), BZIP2 (.bz2), BZIP3 (.bz3),
CAB (.cab), CHM (.chm), COMPRESS (.Z), CPIO (.cpio), DEB (.deb), DMS (.dms),
FLAC (.flac), GZIP (.gz), ISO (.iso), LRZIP (.lrz), LZH (.lha, .lzh),
LZIP (.lz), LZMA (.lzma), LZOP (.lzo), RPM (.rpm), RAR (.rar, .cbr),
RZIP (.rz), SHN (.shn), TAR (.tar, .cbt), XZ (.xz),
RZIP (.rz), SHN (.shn), TAR (.tar, .cbt), UDF (.udf), XZ (.xz),
ZIP (.zip, .jar, .cbz), ZOO (.zoo) and ZSTANDARD (.zst) archive formats.

It relies on helper applications to handle those archive formats
Expand Down
3 changes: 2 additions & 1 deletion doc/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
3.0.4 (released xx.xx.xxxx)
*
* Added support for UDF (.udf) archives with 7z.
Closes: GH bug #80

3.0.3 (released 04.11.2024)
* Fix UnicodeDecode errors when logging, especially on windows systems.
Expand Down
2 changes: 1 addition & 1 deletion doc/patool.1
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ BZIP3 (.bz3), CAB (.cab), CHM (.chm), COMPRESS (.Z), CPIO (.cpio),
DEB (.deb), DMS (.dms),
FLAC (.flac), GZIP (.gz), ISO (.iso), LRZIP (.lrz), LZH (.lha, .lzh),
LZIP (.lz), LZMA (.lzma), LZOP (.lzo), RPM (.rpm), RAR (.rar, .cbr),
RZIP (.rz), SHN (.shn), TAR (.tar, .cbt), XZ (.xz), ZIP (.zip, .jar, .cbz),
RZIP (.rz), SHN (.shn), TAR (.tar, .cbt), UDF (.udf), XZ (.xz), ZIP (.zip, .jar, .cbz),
ZOO (.zoo), ZPAQ (.zpaq) and ZSTANDARD (.zst) archive formats.
.br
It relies on helper applications to handle those archive formats
Expand Down
6 changes: 3 additions & 3 deletions doc/patool.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ DESCRIPTION
(.Z), CPIO (.cpio), DEB (.deb), DMS (.dms), FLAC (.flac), GZIP
(.gz), ISO (.iso), LRZIP (.lrz), LZH (.lha, .lzh), LZIP (.lz),
LZMA (.lzma), LZOP (.lzo), RPM (.rpm), RAR (.rar, .cbr), RZIP
(.rz), SHN (.shn), TAR (.tar, .cbt), XZ (.xz), ZIP (.zip, .jar,
.cbz), ZOO (.zoo), ZPAQ (.zpaq) and ZSTANDARD (.zst) archive
formats.
(.rz), SHN (.shn), TAR (.tar, .cbt), UDF (.udf), XZ (.xz), ZIP
(.zip, .jar, .cbz), ZOO (.zoo), ZPAQ (.zpaq) and ZSTANDARD
(.zst) archive formats.
It relies on helper applications to handle those archive for‐
mats (for example xz for XZ (.xz) archives).

Expand Down
2 changes: 1 addition & 1 deletion doc/web/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ APE (.ape), AR (.a), ARC (.arc), ARJ (.arj), BZIP2 (.bz2), BZIP3 (.bz3),
CAB (.cab), CHM (.chm), COMPRESS (.Z), CPIO (.cpio), DEB (.deb), DMS (.dms),
FLAC (.flac), GZIP (.gz), ISO (.iso), LRZIP (.lrz), LZH (.lha, .lzh),
LZIP (.lz), LZMA (.lzma), LZOP (.lzo), RPM (.rpm), RAR (.rar, .cbr),
RZIP (.rz), SHN (.shn), TAR (.tar, .cbt), XZ (.xz),
RZIP (.rz), SHN (.shn), TAR (.tar, .cbt), UDF (.udf), XZ (.xz),
ZIP (.zip, .jar, .cbz), ZOO (.zoo) and ZSTANDARD (.zst) archive formats.

It relies on helper applications to handle those archive formats
Expand Down
14 changes: 14 additions & 0 deletions patoolib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
'shar',
'shn',
'tar',
'udf',
'vhd',
'wim',
'xz',
Expand Down Expand Up @@ -142,6 +143,7 @@
'application/x-rzip': 'rzip',
'application/x-shar': 'shar',
'application/x-tar': 'tar',
'application/x-iso13346-image': 'udf',
'application/x-vhd': 'vhd',
'application/x-xz': 'xz',
'application/x-zip-compressed': 'zip',
Expand Down Expand Up @@ -329,6 +331,11 @@
None: ('tar', 'star', 'bsdtar', 'py_tarfile'),
'extract': ('unar',),
},
'udf': {
'extract': ('7z',),
'list': ('7z',),
'test': ('7z',),
},
'vhd': {
'extract': (
'7z',
Expand Down Expand Up @@ -444,6 +451,13 @@
'7zzs',
)
},
'udf': {
None: (
'7z',
'7zz',
'7zzs',
)
},
'vhd': {
None: (
'7z',
Expand Down
14 changes: 7 additions & 7 deletions patoolib/programs/p7zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def extract_7z_singlefile(

extract_zip = extract_rar = extract_cab = extract_chm = extract_arj = extract_cpio = (
extract_rpm
) = extract_deb = extract_iso = extract_vhd = extract_wim = extract_7z
) = extract_deb = extract_iso = extract_udf = extract_vhd = extract_wim = extract_7z


def list_7z(archive, compression, cmd, verbosity, interactive, password=None):
Expand All @@ -72,9 +72,9 @@ def list_7z(archive, compression, cmd, verbosity, interactive, password=None):

list_bzip2 = list_gzip = list_zip = list_compress = list_rar = list_cab = list_chm = (
list_arj
) = list_cpio = list_rpm = list_deb = list_iso = list_xz = list_lzma = list_vhd = (
list_wim
) = list_7z
) = list_cpio = list_rpm = list_deb = list_iso = list_xz = list_lzma = list_udf = (
list_vhd
) = list_wim = list_7z


def test_7z(archive, compression, cmd, verbosity, interactive, password=None):
Expand All @@ -92,9 +92,9 @@ def test_7z(archive, compression, cmd, verbosity, interactive, password=None):

test_bzip2 = test_gzip = test_zip = test_compress = test_rar = test_cab = test_chm = (
test_arj
) = test_cpio = test_rpm = test_deb = test_iso = test_xz = test_lzma = test_vhd = (
test_wim
) = test_7z
) = test_cpio = test_rpm = test_deb = test_iso = test_xz = test_lzma = test_udf = (
test_vhd
) = test_wim = test_7z


def create_7z(
Expand Down
14 changes: 7 additions & 7 deletions patoolib/programs/p7zz.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@

extract_zip = extract_rar = extract_cab = extract_chm = extract_arj = extract_cpio = (
extract_rpm
) = extract_deb = extract_iso = extract_vhd = extract_wim = extract_7z
) = extract_deb = extract_iso = extract_udf = extract_vhd = extract_wim = extract_7z

from .p7zip import list_7z

list_bzip2 = list_gzip = list_zip = list_compress = list_rar = list_cab = list_chm = (
list_arj
) = list_cpio = list_rpm = list_deb = list_iso = list_xz = list_lzma = list_vhd = (
list_wim
) = list_7z
) = list_cpio = list_rpm = list_deb = list_iso = list_xz = list_lzma = list_udf = (
list_vhd
) = list_wim = list_7z

from .p7zip import test_7z

test_bzip2 = test_gzip = test_zip = test_compress = test_rar = test_cab = test_chm = (
test_arj
) = test_cpio = test_rpm = test_deb = test_iso = test_xz = test_lzma = test_vhd = (
test_wim
) = test_7z
) = test_cpio = test_rpm = test_deb = test_iso = test_xz = test_lzma = test_udf = (
test_vhd
) = test_wim = test_7z

# ruff: noqa: F401
from .p7zip import (
Expand Down
3 changes: 3 additions & 0 deletions tests/archives/test_7z.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def test_7z(self):
self.archive_list('t.rpm')
self.archive_list('t.deb')
self.archive_list('t.iso')
self.archive_list('t.udf')
self.archive_list('t.vhd')
self.archive_extract('t.txt.gz', check=Content.Singlefile)
self.archive_extract('t.txt.bz2', check=Content.Singlefile)
Expand All @@ -57,6 +58,7 @@ def test_7z(self):
self.archive_extract('t.rpm', check=None)
self.archive_extract('t.deb', check=None)
self.archive_extract('t.iso')
self.archive_extract('t.udf')
self.archive_extract('t.vhd', check=None)
self.archive_test('t.txt.gz')
self.archive_test('t.txt.bz2')
Expand All @@ -70,6 +72,7 @@ def test_7z(self):
self.archive_test('t.rpm')
self.archive_test('t.deb')
self.archive_test('t.iso')
self.archive_test('t.udf')
self.archive_test('t.vhd')
self.archive_create('t.txt.gz', check=Content.Singlefile)
self.archive_create('t.txt.bz2', check=Content.Singlefile)
Expand Down
Binary file added tests/data/t.udf
Binary file not shown.

0 comments on commit c129b47

Please sign in to comment.