Teknomancer / beezer

Beezer is an archiving tool for the Haiku operating system.
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

zstandard (zst) archive support #7

Open augiedoggie opened 3 years ago

augiedoggie commented 3 years ago

zst seems to be becoming more popular. It would be nice to have a handler and shouldn't be much work to support.

Teknomancer commented 3 years ago

Some notes:

Teknomancer commented 3 years ago

Doesn't seem possible to get individual file names compressed by zstd (when fed multiple individual files rather than a ".tar")

https://unix.stackexchange.com/questions/549725/how-can-i-separate-multiple-files-from-single-file-caused-by-zstd-r-folder-o-o

EDIT: We ought to be able to handle it like .tar.XYZ.

Teknomancer commented 3 years ago

Added Zstd implementation in 62eb75ac0dd21cef4a3a6cae6dde48104eb58ad2

I've done very basic testing of creating and extracting ".tar.zst" as well as extracting a pure ".zst".

Compression levels are supported (although odd numbers from 1 to 22 to keep UI tidy and difference is marginal between subsequent levels for the most part).

Will probably test this more when I get the time and more options can perhaps be added (besides compression level) at some point.

Teknomancer commented 3 years ago

The vector icon in the ZstdArchiver.rdef needs to be updated properly later. For now I had just copied the icon data from one of the other formats. Putting it here so I don't forget it later.

augiedoggie commented 3 years ago

If you're talking about the vector_icon resource in each of the archiver rdef files, that is a generic icon that I created to make the add-on binaries look pretty and isn't specific to any file type.

Teknomancer commented 3 years ago

Ah, okay. Good to know. Yes that's the resource I meant.

augiedoggie commented 3 years ago

I just noticed that the zstd tools on gcc2 builds of Haiku have been compiled with different options. I may have to investigate why lzma support isn't enabled in the haikuports recipe.

The stderr message from running tar tvf file.tar.zst:

zstd: /*stdin*\: xz/lzma file cannot be uncompressed (zstd compiled without HAVE_LZMA) -- ignored 
tar: Child returned status 1
tar: Error is not recoverable: exiting now