Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ocaml-csexp for openSUSE:Factory checked in at 2023-05-12 20:38:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ocaml-csexp (Old) and /work/SRC/openSUSE:Factory/.ocaml-csexp.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ocaml-csexp" Fri May 12 20:38:48 2023 rev:4 rq:1086732 version:1.5.2 Changes: -------- --- /work/SRC/openSUSE:Factory/ocaml-csexp/ocaml-csexp.changes 2022-04-12 21:49:54.119246856 +0200 +++ /work/SRC/openSUSE:Factory/.ocaml-csexp.new.1533/ocaml-csexp.changes 2023-05-12 20:41:27.367241995 +0200 @@ -1,0 +2,6 @@ +Fri May 5 05:05:05 UTC 2023 - oher...@suse.de + +- Update to version 1.5.2 + fix: serialized length + +------------------------------------------------------------------- Old: ---- ocaml-csexp-1.5.1.tar.xz New: ---- ocaml-csexp-1.5.2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ocaml-csexp.spec ++++++ --- /var/tmp/diff_new_pack.DbQtZp/_old 2023-05-12 20:41:27.775244237 +0200 +++ /var/tmp/diff_new_pack.DbQtZp/_new 2023-05-12 20:41:27.783244282 +0200 @@ -1,7 +1,7 @@ # # spec file for package ocaml-csexp # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -21,6 +21,8 @@ %if "%build_flavor" == "testsuite" %if %{without ocaml_csexp_testsuite} ExclusiveArch: do-not-build +%else +ExclusiveArch: aarch64 ppc64 ppc64le riscv64 s390x x86_64 %endif %define nsuffix -testsuite %else @@ -29,7 +31,7 @@ %define pkg ocaml-csexp Name: %pkg%nsuffix -Version: 1.5.1 +Version: 1.5.2 Release: 0 %{?ocaml_preserve_bytecode} Summary: Parsing and printing of S-expressions in Canonical form @@ -39,8 +41,8 @@ URL: https://opam.ocaml.org/packages/csexp Source0: %pkg-%version.tar.xz BuildRequires: ocaml -BuildRequires: ocaml-dune -BuildRequires: ocaml-rpm-macros >= 20220409 +BuildRequires: ocaml-dune >= 3.4 +BuildRequires: ocaml-rpm-macros >= 20230101 %if "%build_flavor" == "testsuite" BuildRequires: ocamlfind(csexp) ++++++ _service ++++++ --- /var/tmp/diff_new_pack.DbQtZp/_old 2023-05-12 20:41:27.835244567 +0200 +++ /var/tmp/diff_new_pack.DbQtZp/_new 2023-05-12 20:41:27.839244589 +0200 @@ -1,7 +1,7 @@ <services> <service name="tar_scm" mode="disabled"> <param name="filename">ocaml-csexp</param> - <param name="revision">7eeb86206819d2b1782d6cde1be9d6cf8b5fc851</param> + <param name="revision">e6c4768e10c61bcb04d09748744dad55602149c6</param> <param name="scm">git</param> <param name="submodules">disable</param> <param name="url">https://github.com/ocaml-dune/csexp.git</param> ++++++ ocaml-csexp-1.5.1.tar.xz -> ocaml-csexp-1.5.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-csexp-1.5.1/.ocamlformat new/ocaml-csexp-1.5.2/.ocamlformat --- old/ocaml-csexp-1.5.1/.ocamlformat 2021-03-31 13:53:55.000000000 +0200 +++ new/ocaml-csexp-1.5.2/.ocamlformat 2023-03-24 05:32:51.000000000 +0100 @@ -1,19 +1,12 @@ -version=0.15.0 +version=0.24.1 +profile=conventional +ocaml-version=4.08.0 break-separators=before dock-collection-brackets=false -break-sequences=true doc-comments=before -field-space=loose let-and=sparse -sequence-style=terminator type-decl=sparse -wrap-comments=true -if-then-else=k-r -let-and=sparse -space-around-records -space-around-lists -space-around-arrays cases-exp-indent=2 -break-cases=all -indicate-nested-or-patterns=unsafe-no +break-cases=fit-or-vertical parse-docstrings=true +module-item-spacing=sparse diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-csexp-1.5.1/CHANGES.md new/ocaml-csexp-1.5.2/CHANGES.md --- old/ocaml-csexp-1.5.1/CHANGES.md 2021-03-31 13:53:55.000000000 +0200 +++ new/ocaml-csexp-1.5.2/CHANGES.md 2023-03-24 05:32:51.000000000 +0100 @@ -1,3 +1,8 @@ +# 1.5.2 + +- Fix `Csexp.serialised_length`. Previously, it would under count by 2 because + it did not take the parentheses into account. (#22, @jchavarri) + # 1.5.1 - Drop dependency on result and compatibility with OCaml 4.02 (#17, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-csexp-1.5.1/Makefile new/ocaml-csexp-1.5.2/Makefile --- old/ocaml-csexp-1.5.1/Makefile 2021-03-31 13:53:55.000000000 +0200 +++ new/ocaml-csexp-1.5.2/Makefile 2023-03-24 05:32:51.000000000 +0100 @@ -22,10 +22,10 @@ dune-release: dune-release tag - dune-release distrib --skip-build --skip-lint --skip-tests -n csexp + dune-release distrib --skip-build --skip-lint --skip-tests # See https://github.com/ocamllabs/dune-release/issues/206 - DUNE_RELEASE_DELEGATE=github-dune-release-delegate dune-release publish distrib --verbose -n csexp - dune-release opam pkg -n csexp - dune-release opam submit -n csexp + DUNE_RELEASE_DELEGATE=github-dune-release-delegate dune-release publish distrib --verbose + dune-release opam pkg + dune-release opam submit .PHONY: default install uninstall reinstall clean test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-csexp-1.5.1/bench/csexp_bench.ml new/ocaml-csexp-1.5.2/bench/csexp_bench.ml --- old/ocaml-csexp-1.5.1/bench/csexp_bench.ml 2021-03-31 13:53:55.000000000 +0200 +++ new/ocaml-csexp-1.5.2/bench/csexp_bench.ml 2023-03-24 05:32:51.000000000 +0100 @@ -11,8 +11,7 @@ let atom = Sexp.Atom (String.make 128 'x') let rec gen_sexp depth = - if depth = 0 then - atom + if depth = 0 then atom else let x = gen_sexp (depth - 1) in List [ x; x ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-csexp-1.5.1/csexp.opam new/ocaml-csexp-1.5.2/csexp.opam --- old/ocaml-csexp-1.5.1/csexp.opam 2021-03-31 13:53:55.000000000 +0200 +++ new/ocaml-csexp-1.5.2/csexp.opam 2023-03-24 05:32:51.000000000 +0100 @@ -29,12 +29,13 @@ doc: "https://ocaml-dune.github.io/csexp/" bug-reports: "https://github.com/ocaml-dune/csexp/issues" depends: [ - "dune" {>= "1.11"} + "dune" {>= "3.4"} "ocaml" {>= "4.03.0"} + "odoc" {with-doc} ] dev-repo: "git+https://github.com/ocaml-dune/csexp.git" build: [ - ["dune" "subst"] {dev} + ["dune" "subst"] {pinned} [ "dune" "build" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-csexp-1.5.1/dune-project new/ocaml-csexp-1.5.2/dune-project --- old/ocaml-csexp-1.5.1/dune-project 2021-03-31 13:53:55.000000000 +0200 +++ new/ocaml-csexp-1.5.2/dune-project 2023-03-24 05:32:51.000000000 +0100 @@ -1,8 +1,6 @@ -(lang dune 1.11) +(lang dune 3.4) (name csexp) -(allow_approximate_merlin) - (license MIT) (maintainers "Jeremie Dimino <jere...@dimino.org>") (authors diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-csexp-1.5.1/flake.lock new/ocaml-csexp-1.5.2/flake.lock --- old/ocaml-csexp-1.5.1/flake.lock 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-csexp-1.5.2/flake.lock 2023-03-24 05:32:51.000000000 +0100 @@ -0,0 +1,58 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1678901627, + "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nix-filter": { + "locked": { + "lastModified": 1678109515, + "narHash": "sha256-C2X+qC80K2C1TOYZT8nabgo05Dw2HST/pSn6s+n6BO8=", + "owner": "numtide", + "repo": "nix-filter", + "rev": "aa9ff6ce4a7f19af6415fb3721eaa513ea6c763c", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "nix-filter", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1679628852, + "narHash": "sha256-mrBaaWvxYItnawGndPjQGMKpQK6nF8ljzuvm0DLgnr4=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "f3a0f82e577771b3cf116580b78c66e7b2a89d5c", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nix-filter": "nix-filter", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-csexp-1.5.1/flake.nix new/ocaml-csexp-1.5.2/flake.nix --- old/ocaml-csexp-1.5.1/flake.nix 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-csexp-1.5.2/flake.nix 2023-03-24 05:32:51.000000000 +0100 @@ -0,0 +1,42 @@ +{ + description = "csexp Nix Flake"; + + inputs.nix-filter.url = "github:numtide/nix-filter"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + inputs.nixpkgs.url = "github:nixos/nixpkgs"; + + outputs = { self, nixpkgs, flake-utils, nix-filter }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages."${system}"; + inherit (pkgs.ocamlPackages) buildDunePackage; + in + rec { + packages = rec { + default = csexp; + csexp = buildDunePackage { + pname = "csexp"; + version = "n/a"; + src = ./.; + duneVersion = "3"; + propagatedBuildInputs = with pkgs.ocamlPackages; [ ]; + checkInputs = with pkgs.ocamlPackages; [ + ppx_inline_test + ppx_expect + ]; + doCheck = true; + }; + }; + devShells.default = pkgs.mkShell { + inputsFrom = pkgs.lib.attrValues packages; + buildInputs = with pkgs.ocamlPackages; [ + dune-release + pkgs.ccls + ocaml-lsp + pkgs.ocamlformat + ppx_bench + core_bench + ]; + }; + }); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-csexp-1.5.1/src/csexp.ml new/ocaml-csexp-1.5.2/src/csexp.ml --- old/ocaml-csexp-1.5.1/src/csexp.ml 2021-03-31 13:53:55.000000000 +0200 +++ new/ocaml-csexp-1.5.2/src/csexp.ml 2023-03-24 05:32:51.000000000 +0100 @@ -147,8 +147,7 @@ parse_error "atom too big to represent" else ( t.n <- len; - Await - ) + Await) | Parsing_length, ':' -> t.state <- Init; Atom t.n @@ -229,11 +228,11 @@ | exception _ -> Error (len, premature_end_of_input) | atom -> let pos = pos + 1 + atom_len in - k s pos len lexer (Stack.add_atom atom stack) ) + k s pos len lexer (Stack.add_atom atom stack)) | (L.Await | L.Lparen | L.Rparen) as x -> ( match Stack.add_token x stack with | exception Parse_error msg -> Error (pos, msg) - | stack -> k s (pos + 1) len lexer stack ) + | stack -> k s (pos + 1) len lexer stack) [@@inlined always] let parse_string = @@ -242,15 +241,12 @@ match feed_eoi_single lexer stack with | Error msg -> Error (pos, msg) | Ok _ as ok -> ok - else - one_token s pos len lexer stack cont + else one_token s pos len lexer stack cont and cont s pos len lexer stack = match stack with | Stack.Sexp (sexp, Empty) -> - if pos = len then - Ok sexp - else - Error (pos, "data after canonical S-expression") + if pos = len then Ok sexp + else Error (pos, "data after canonical S-expression") | stack -> loop s pos len lexer stack in fun s -> loop s 0 (String.length s) (Lexer.create ()) Empty @@ -261,8 +257,7 @@ match feed_eoi_many lexer stack with | Error msg -> Error (pos, msg) | Ok _ as ok -> ok - else - one_token s pos len lexer stack loop + else one_token s pos len lexer stack loop in fun s -> loop s 0 (String.length s) (Lexer.create ()) Empty @@ -271,7 +266,7 @@ | L.Atom n -> ( match really_input_string ic n with | exception End_of_file -> raise (Parse_error premature_end_of_input) - | s -> Stack.add_atom s stack ) + | s -> Stack.add_atom s stack) | (L.Await | L.Lparen | L.Rparen) as x -> Stack.add_token x stack let input_opt = @@ -293,7 +288,7 @@ loop ic lexer (Stack.add_token x Empty) with | Parse_error msg -> Error msg - | End_of_file -> Error premature_end_of_input ) + | End_of_file -> Error premature_end_of_input) let input ic = match input_opt ic with @@ -324,7 +319,7 @@ incr len_len done; acc + !len_len + 1 + len - | List l -> List.fold_left loop acc l + | List l -> 2 + List.fold_left loop acc l in fun t -> loop 0 t @@ -387,9 +382,9 @@ return (Ok (Stack.add_atom s stack)) | (L.Await | L.Lparen | L.Rparen) as x -> return - ( match Stack.add_token x stack with + (match Stack.add_token x stack with | exception Parse_error msg -> Error msg - | stack -> Ok stack ) + | stack -> Ok stack) let parse = let rec loop input lexer stack = @@ -398,7 +393,7 @@ | Ok c -> ( one_token input c lexer stack >>=* function | Sexp (sexp, Empty) -> return (Ok sexp) - | stack -> loop input lexer stack ) + | stack -> loop input lexer stack) in fun input -> loop input (Lexer.create ()) Empty diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-csexp-1.5.1/src/csexp.mli new/ocaml-csexp-1.5.2/src/csexp.mli --- old/ocaml-csexp-1.5.1/src/csexp.mli 2021-03-31 13:53:55.000000000 +0200 +++ new/ocaml-csexp-1.5.2/src/csexp.mli 2023-03-24 05:32:51.000000000 +0100 @@ -148,7 +148,9 @@ For instance, the prefix "1:x((1:y1:z)" will be represented as: - {[ Sexp (List [ Atom "y"; Atom "z" ], Open (Sexp (Atom "x", Empty))) ]} + {[ + Sexp (List [ Atom "y"; Atom "z" ], Open (Sexp (Atom "x", Empty))) + ]} The {!Stack} module offers various primitives to open or close parentheses or insert an atom. And for convenience it provides a @@ -234,8 +236,8 @@ let rec loop s pos len lexer stack = if pos = len then ( Lexer.feed_eoi lexer; - Stack.to_list stack - ) else + Stack.to_list stack) + else match Lexer.feed lexer (String.unsafe_get s pos) with | Atom atom_len -> let atom = extract_atom s (pos + 1) atom_len in @@ -300,8 +302,8 @@ # to_list (Sexp (Atom "y", Sexp (Atom "x", Empty)));; - : Stack.t list = [Atom "x"; Atom "y"] ]} - @raise Parse_error if the stack contains open parentheses that has not - been closed. *) + @raise Parse_error + if the stack contains open parentheses that has not been closed. *) val to_list : t -> sexp list (** Add a left parenthesis. *) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-csexp-1.5.1/test/test.ml new/ocaml-csexp-1.5.2/test/test.ml --- old/ocaml-csexp-1.5.1/test/test.ml 2021-03-31 13:53:55.000000000 +0200 +++ new/ocaml-csexp-1.5.2/test/test.ml 2023-03-24 05:32:51.000000000 +0100 @@ -140,3 +140,29 @@ let%expect_test "parse_string_many - parse many csexp" = parse_many "(3:foo)(3:bar)"; [%expect {| Ok "(3:foo)"Ok "(3:bar)" |}] + +let%expect_test "serialised_length" = + let csexp = Sexp.Atom "xxx" in + print_endline (Csexp.to_string csexp); + print_int (Csexp.serialised_length csexp); + [%expect {| + 3:xxx + 5 |}]; + let csexp = Sexp.List [] in + print_endline (Csexp.to_string csexp); + print_int (Csexp.serialised_length csexp); + [%expect {| + () + 2 |}]; + let csexp = Sexp.List [ Atom "xxx" ] in + print_endline (Csexp.to_string csexp); + print_int (Csexp.serialised_length csexp); + [%expect {| + (3:xxx) + 7 |}]; + let csexp = Sexp.List [ Atom "xxx"; Atom "xxx" ] in + print_endline (Csexp.to_string csexp); + print_int (Csexp.serialised_length csexp); + [%expect {| + (3:xxx3:xxx) + 12 |}]