<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 26, 2017 at 2:43 PM, Rob Landley <span dir="ltr"><<a href="mailto:rob@landley.net" target="_blank">rob@landley.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On 04/24/2017 03:43 PM, enh wrote:<br>
> Bringing the zlib-based gzip/gunzip/zcat over to toybox is a problem for<br>
> another day,<br>
<br>
</span>Blah, I should take this one.<br>
<br>
I have deflate decompression side implemented already (and working at<br>
one point, although I just tested "make zcat" and got a bad crc<br>
decompressing the musl-1.1.16.gz tarball). I have the first 1/3 or so of<br>
compression side implemented and somewhere around here is a version<br>
that's about 2/3 through. I stopped at "where do dictionary resets<br>
happen" and basically go the answer "nobody seems to agree, just do it<br>
every 250k". (Which means my gzip and other gzip won't necessarily<br>
produce the same binary, but it should extract the same. There's<br>
actually a format hitch you can do sticking in gratuitous resets to<br>
allow parallel decompression, it's a bit like mp4 streaming mode<br>
sticking in extra keyframes, only noticeably cheaper. :)<br>
<br>
Adding zlib mode to that is basically the same plumbing as<br>
toys/*/md5sum.c does for libcrypto.<br>
<br>
Lemme try to find a chunk of time to devote to that...</blockquote><div><br></div><div>if you're actually going to start to look, i'll attach my port of the current toolbox implementation.</div><div><br></div><div><div>---</div><div> Config.in | 6 ++</div><div> scripts/make.sh | 2 +-</div><div> toys/pending/compress.c | 93 ----------------------</div><div> toys/pending/gzip.c | 199 ++++++++++++++++++++++++++++++++++++++++++++++++</div><div> 4 files changed, 206 insertions(+), 94 deletions(-)</div><div> create mode 100644 toys/pending/gzip.c</div></div><div><br></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"><span class="gmail-"><br>
> but at least the tests are easy...<br>
><br>
> (These tests pass with TEST_HOST and on the toolbox versions, but the<br>
> toybox toys are in pending and very broken.)<br>
<br>
</span>The problem is this is just testing that gzip and gunzip reverse each<br>
other. If they share infrastructure and screw something up the same way,<br>
what have you proved? Also you can't test gunzip without gzip being present.<br>
<br>
For bzip I added a tests/files/bzcat (and already had a lot of<br>
tests/files/blkid/*.bz2). I'd like to have at least a couple canned .gz<br>
files for reference under tests/files.<br>
<br>
I'll try to take a closer look at this later...<br>
<span class="gmail-HOEnZb"><font color="#888888"><br>
Rob<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Elliott Hughes - <a href="http://who/enh" target="_blank">http://who/enh</a> - <a href="http://jessies.org/~enh/" target="_blank">http://jessies.org/~enh/</a><br>Android native code/tools questions? Mail me/drop by/add me as a reviewer.</div>
</div></div>