diff -Nru camlzip-1.08/Changes camlzip-1.09/Changes --- camlzip-1.08/Changes 2019-06-21 09:19:54.000000000 +0000 +++ camlzip-1.09/Changes 2019-09-29 16:11:02.000000000 +0000 @@ -1,3 +1,8 @@ +Release 1.09: +- GPR#22: Add a Gzip.flush_continue function that allows the user to + flush the contents of the zip buffer all the way to disk but then + continue writing to the zipped channel [James Owen] + Release 1.08: - ocamlfind is now mandatory as a consequence of GPR#4 - GPR#4: use ocamlfind and $(EXT_...) configuration variables for better diff -Nru camlzip-1.08/debian/changelog camlzip-1.09/debian/changelog --- camlzip-1.08/debian/changelog 2019-07-17 19:02:48.000000000 +0000 +++ camlzip-1.09/debian/changelog 2020-02-21 01:31:06.000000000 +0000 @@ -1,3 +1,24 @@ +camlzip (1.09-2build1) focal; urgency=medium + + * No change rebuild against new ocaml ABI + + -- Dimitri John Ledkov Fri, 21 Feb 2020 01:31:06 +0000 + +camlzip (1.09-2) unstable; urgency=medium + + * patch tests-ocaml4.08: migrate a test to ocaml4.08 (closes: #944280) + * debian/watch: use dversionmangle to cope with the strange habitude of + upstream to not separate the parts of a version by a dot. + + -- Ralf Treinen Thu, 07 Nov 2019 22:27:13 +0100 + +camlzip (1.09-1) unstable; urgency=medium + + * New upstream release + * Standards-Version 4.4.1 (no change) + + -- Ralf Treinen Fri, 01 Nov 2019 21:58:13 +0100 + camlzip (1.08-1) unstable; urgency=medium [ Jelmer Vernooij ] diff -Nru camlzip-1.08/debian/control camlzip-1.09/debian/control --- camlzip-1.08/debian/control 2019-07-17 19:02:48.000000000 +0000 +++ camlzip-1.09/debian/control 2020-02-21 01:31:06.000000000 +0000 @@ -1,7 +1,8 @@ Source: camlzip Section: ocaml Priority: optional -Maintainer: Debian OCaml Maintainers +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian OCaml Maintainers Uploaders: Samuel Mimram , Ralf Treinen , @@ -13,7 +14,7 @@ ocaml-findlib, dh-ocaml (>= 0.9) Homepage: https://github.com/xavierleroy/camlzip/ -Standards-Version: 4.4.0 +Standards-Version: 4.4.1 Vcs-Git: https://salsa.debian.org/ocaml-team/camlzip.git Vcs-Browser: https://salsa.debian.org/ocaml-team/camlzip diff -Nru camlzip-1.08/debian/patches/series camlzip-1.09/debian/patches/series --- camlzip-1.08/debian/patches/series 2019-07-17 19:02:48.000000000 +0000 +++ camlzip-1.09/debian/patches/series 2019-11-07 21:27:13.000000000 +0000 @@ -1 +1,2 @@ 0003-Add-plain_uncompress.patch +tests-ocaml4.08 diff -Nru camlzip-1.08/debian/patches/tests-ocaml4.08 camlzip-1.09/debian/patches/tests-ocaml4.08 --- camlzip-1.08/debian/patches/tests-ocaml4.08 1970-01-01 00:00:00.000000000 +0000 +++ camlzip-1.09/debian/patches/tests-ocaml4.08 2019-11-07 21:27:13.000000000 +0000 @@ -0,0 +1,25 @@ +Author: Ralf Treinen +Description: Migrate test to ocaml4.08 + +Index: camlzip/test/testzlib.ml +=================================================================== +--- camlzip.orig/test/testzlib.ml 2019-11-06 08:48:20.955383507 +0100 ++++ camlzip/test/testzlib.ml 2019-11-07 22:10:46.257175032 +0100 +@@ -1,7 +1,7 @@ + let compress infile outfile = + let ic = open_in_bin infile + and oc = open_out_bin outfile in +- Zlib.compress (fun buf -> input ic buf 0 (String.length buf)) ++ Zlib.compress (fun buf -> input ic buf 0 (Bytes.length buf)) + (fun buf len -> output oc buf 0 len); + close_in ic; + close_out oc +@@ -9,7 +9,7 @@ + let uncompress infile outfile = + let ic = open_in_bin infile + and oc = open_out_bin outfile in +- Zlib.uncompress (fun buf -> input ic buf 0 (String.length buf)) ++ Zlib.uncompress (fun buf -> input ic buf 0 (Bytes.length buf)) + (fun buf len -> output oc buf 0 len); + close_in ic; + close_out oc diff -Nru camlzip-1.08/debian/watch camlzip-1.09/debian/watch --- camlzip-1.08/debian/watch 2019-07-17 19:02:48.000000000 +0000 +++ camlzip-1.09/debian/watch 2019-11-07 21:27:13.000000000 +0000 @@ -1,4 +1,4 @@ version=4 -opts="uversionmangle=s/-rc/~rc/" \ - https://github.com/xavierleroy/camlzip/releases .*/(.*)\.tar\.gz +opts="uversionmangle=s/-rc/~rc/,dversionmangle=s/\.//" \ + https://github.com/xavierleroy/camlzip/releases .*/rel(.*)\.tar\.gz diff -Nru camlzip-1.08/gzip.ml camlzip-1.09/gzip.ml --- camlzip-1.08/gzip.ml 2019-06-21 09:19:54.000000000 +0000 +++ camlzip-1.09/gzip.ml 2019-09-29 16:11:02.000000000 +0000 @@ -34,7 +34,7 @@ begin try let id1 = input_byte ic in let id2 = input_byte ic in - if id1 <> 0x1F || id2 <> 0x8B then + if id1 <> 0x1F || id2 <> 0x8B then raise(Error("bad magic number, not a gzip file")); let cm = input_byte ic in if cm <> 8 then @@ -75,7 +75,7 @@ let open_in filename = let ic = Pervasives.open_in_bin filename in - try + try open_in_chan ic with exn -> Pervasives.close_in ic; raise exn @@ -128,7 +128,7 @@ try let crc = read_int32 iz in let size = read_int32 iz in - if iz.in_crc <> crc then + if iz.in_crc <> crc then raise(Error("CRC mismatch, data corrupted")); if iz.in_size <> size then raise(Error("size mismatch, data corrupted")); @@ -198,15 +198,16 @@ let open_out ?(level = 6) filename = open_out_chan ~level (Pervasives.open_out_bin filename) +let flush_and_reset_out_buffer oz = + Pervasives.output oz.out_chan oz.out_buffer 0 oz.out_pos; + oz.out_pos <- 0; + oz.out_avail <- Bytes.length oz.out_buffer + let rec output oz buf pos len = if pos < 0 || len < 0 || pos + len > Bytes.length buf then invalid_arg "Gzip.output"; (* If output buffer is full, flush it *) - if oz.out_avail = 0 then begin - Pervasives.output oz.out_chan oz.out_buffer 0 oz.out_pos; - oz.out_pos <- 0; - oz.out_avail <- Bytes.length oz.out_buffer - end; + if oz.out_avail = 0 then flush_and_reset_out_buffer oz; (* Patch request #1428: Zlib disallows zero-length writes *) if len > 0 then begin let (_, used_in, used_out) = @@ -240,14 +241,10 @@ r := Int32.shift_right_logical !r 8 done -let flush oz = +let flush_to_out_chan oz = let rec do_flush () = (* If output buffer is full, flush it *) - if oz.out_avail = 0 then begin - Pervasives.output oz.out_chan oz.out_buffer 0 oz.out_pos; - oz.out_pos <- 0; - oz.out_avail <- Bytes.length oz.out_buffer - end; + if oz.out_avail = 0 then flush_and_reset_out_buffer oz; let (finished, _, used_out) = Zlib.deflate oz.out_stream oz.out_buffer 0 0 oz.out_buffer oz.out_pos oz.out_avail @@ -257,8 +254,16 @@ if not finished then do_flush() in do_flush(); (* Final data flush *) - if oz.out_pos > 0 then - Pervasives.output oz.out_chan oz.out_buffer 0 oz.out_pos; + if oz.out_pos > 0 then flush_and_reset_out_buffer oz + +let flush_continue oz = + (* Flush everything to the underlying file channel, then flush the channel. *) + flush_to_out_chan oz; + Pervasives.flush oz.out_chan + +let flush oz = + (* Flush everything to the output channel. *) + flush_to_out_chan oz; (* Write CRC and size *) write_int32 oz.out_chan oz.out_crc; write_int32 oz.out_chan oz.out_size; diff -Nru camlzip-1.08/gzip.mli camlzip-1.09/gzip.mli --- camlzip-1.08/gzip.mli 2019-06-21 09:19:54.000000000 +0000 +++ camlzip-1.09/gzip.mli 2019-09-29 16:11:02.000000000 +0000 @@ -69,7 +69,7 @@ regular file channel (of type [Pervasives.in_channel]); just dispose of the resources associated with the decompression channel. This can be useful if e.g. the underlying file channel - is a network socket on which more (uncompressed) data + is a network socket on which more (uncompressed) data is expected. *) (** {6 Writing to compressed files} *) @@ -80,7 +80,7 @@ val open_out: ?level:int -> string -> out_channel (** Open a compressed file for writing. The argument is the file name. The file is created if it does not exist, or - truncated to zero length if it exists. + truncated to zero length if it exists. The optional [level] argument (an integer between 1 and 9) indicates the compression level, with 1 being the weakest (but fastest) compression and 9 being the strongest @@ -118,6 +118,10 @@ dispose of the resources associated with the compression channel. This can be useful if e.g. the underlying file channel is a network socket on which more data is to be sent. *) +val flush_continue: out_channel -> unit + (** Flush all pending compressed data through both the compression + channel and the underlying regular file channel, but keep both + channels open to accept further data. *) (** {6 Error reporting} *) diff -Nru camlzip-1.08/META-zip camlzip-1.09/META-zip --- camlzip-1.08/META-zip 2019-06-21 09:19:54.000000000 +0000 +++ camlzip-1.09/META-zip 2019-09-29 16:11:02.000000000 +0000 @@ -1,4 +1,4 @@ -version="1.08" +version="1.09" requires="unix" archive(byte)="zip.cma" archive(native)="zip.cmxa"