<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sun, Dec 8, 2024 at 12:51 AM Rob Landley <<a href="mailto:rob@landley.net">rob@landley.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 12/7/24 18:39, enh wrote:<br>
> On Sat, Dec 7, 2024, 18:25 Rob Landley <<a href="mailto:rob@landley.net" target="_blank">rob@landley.net</a>> wrote:<br>
> <br>
>> On 12/6/24 13:57, enh wrote:<br>
>>> We're seeing ever more zstd-compressed files in the wild, so even though<br>
>>> toybox can't compress/decompress zstd without an external helper, it<br>
>>> still seems useful to integrate with any that happens to be on the<br>
>>> system.<br>
>><br>
>> No short option for zstd, even though every other explicit archive<br>
>> format has one?<br>
>><br>
> <br>
> technically there are a couple of other compression options that are<br>
> longopt only,<br>
<br>
In gnu/gnu.<br>
<br>
> such as --lzma (but i haven't added those here because i've<br>
> yet to see them used).<br>
> <br>
> this probably made sense when it was added in 2019, and it wasn't clear how<br>
> popular, zstd was going to become. (especially in comparison to the other<br>
> options we don't have.)<br>
> <br>
> though tbh, zstd seems more popular in non-tar contexts ... i had to ask<br>
> the internet what the long and short extensions were!<br>
<br>
Imma hijack -Z. I'm aware in debian that's "compress" but we've never <br>
supported that format, which was patented in the 1980s causing it to be <br>
completely replaced by gzip except for some old legacy archives you can <br>
"compress -d file.Z | tar x" if you like.<br></blockquote><div><br></div><div>yeah, sounds reasonable.</div><div><br></div><div>coincidentally i saw <a href="https://www.phoronix.com/news/Linux-EFI-Zboot-Gzip-Zstd">https://www.phoronix.com/news/Linux-EFI-Zboot-Gzip-Zstd</a> "Linux EFI Zboot Abandoning "Compression Library Museum", Focusing On Gzip & Zstd" which made me laugh, given that that had been my reaction to the other formats that gnu tar supports (and has single-letter options for!) that toybox tar doesn't (and almost certainly shoudn't) like lzip and lzop. presumably characters from a children's show in a language i don't speak?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
(I just like there to BE a short option, and another obvious contender <br>
isn't presenting itself. Plus I haven't got an obvious way to test this <br>
anyway.)<br></blockquote><div><br></div><div>yeah, i just tested manually. it did occur to me that the test shell script could check to see whether there's a zstd(1) binary on the path, and skip any zstd tests if not?</div><div><br></div><div>(and there's really no excuse for me not adding a file(1) test beyond "we don't have tests for _most_ of the recognized formats", though "this is just a constant prefix match" is a slightly better excuse.)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hmmm...<br>
<br>
<a href="https://www.rfc-editor.org/rfc/rfc8878.txt" rel="noreferrer" target="_blank">https://www.rfc-editor.org/rfc/rfc8878.txt</a><br>
<br>
And according to <a href="https://github.com/facebook/zstd" rel="noreferrer" target="_blank">https://github.com/facebook/zstd</a> the "reference <br>
implementation" is dual licensed BSD and GPL. How bad is...<br>
<br>
<a href="https://github.com/facebook/zstd/blob/dev/lib/legacy/zstd_legacy.h" rel="noreferrer" target="_blank">https://github.com/facebook/zstd/blob/dev/lib/legacy/zstd_legacy.h</a><br>
<br>
Nope, that's terrifying. But:<br>
<br>
<a href="https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md" rel="noreferrer" target="_blank">https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md</a><br>
<br>
Looks possibly doable.<br>
<br>
Rob<br>
</blockquote></div></div>