From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:47974) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVWut-0006O7-3T for guix-patches@gnu.org; Tue, 28 May 2019 03:53:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVWus-0000ZN-36 for guix-patches@gnu.org; Tue, 28 May 2019 03:53:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41420) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hVWus-0000ZD-03 for guix-patches@gnu.org; Tue, 28 May 2019 03:53:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hVWur-0002Hx-UM for guix-patches@gnu.org; Tue, 28 May 2019 03:53:01 -0400 Subject: [bug#35880] [PATCH 1/7] lzlib: Add 'make-lzip-input-port/compressed'. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20190524134238.22802-1-ludo@gnu.org> <87d0k6o3am.fsf@ambrevar.xyz> <87ftp1m1te.fsf@gnu.org> <87blznsxym.fsf@gnu.org> <87ef4jlvbr.fsf@ambrevar.xyz> <87lfyrr554.fsf@gnu.org> <87sgszk3ev.fsf@ambrevar.xyz> Date: Tue, 28 May 2019 09:52:09 +0200 In-Reply-To: <87sgszk3ev.fsf@ambrevar.xyz> (Pierre Neidhardt's message of "Mon, 27 May 2019 23:12:24 +0200") Message-ID: <877eab3tjq.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Pierre Neidhardt Cc: 35880-done@debbugs.gnu.org Pierre Neidhardt skribis: > Ludovic Court=C3=A8s writes: > >>> That said, if the encoder buffer is not empty, I think lz-compress-read >>> should always return something >0. >> >> Yes, probably. The docstring for =E2=80=98lz-compress-read=E2=80=99 say= s: > > Oops, I read the docstring of lz-DEcompress-read. My bad. > >> "Read up to COUNT bytes from the encoder stream, storing the results= in LZFILE-BV. >> Return the number of uncompressed bytes written, a strictly positive i= nteger." >> ^~~~~~~~~~~~~~~~~ > > Bigger oops! This comes from a copy-paste of the gzip docstring which I > forgot to update properly (I did for the decompression functions, but > not for the compression functions). The docstrings should be fixed. I fixed this one in e13354a7ca5a0d5e28e02c4cfce6fecb1ab770e4. >> But that=E2=80=99s OK: the =E2=80=98read!=E2=80=99 method in =E2=80=98ma= ke-lzip-input-port/compressed=E2=80=99 >> can just call =E2=80=98lzwrite!=E2=80=99 again with more data when that = happens, so I=E2=80=99ve >> done that. > > This could work, but I've had some headaches on such assumptions > before. Tests are very necessary here to validate those assumptions ;) Definitely! > The thing is that we are not using lzlib as it is meant to be used > (i.e. with the finish* functions) because of the functional approach of > the binary ports which don't really play well with the procedural > approach of the C library. I think we=E2=80=99re using it the way it=E2=80=99s meant to be used, rough= ly along the lines of the examples of its manual (info "(lzlib) Examples"). (I/O ports are not very =E2=80=9Cfunctional=E2=80=9D.) >> And I pushed the whole thing! :-) > > Hurray! Can't wait to say lz-compressed archives coming to Guix! :) I=E2=80=99ve updated the =E2=80=98guix=E2=80=99 package so people can start= using =E2=80=98guix publish -C lzip=E2=80=99 and fetch substitute from there. Thanks for making it possible! Ludo=E2=80=99.