Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ocaml-num for openSUSE:Factory checked in at 2021-04-29 01:36:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ocaml-num (Old) and /work/SRC/openSUSE:Factory/.ocaml-num.new.12324 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ocaml-num" Thu Apr 29 01:36:46 2021 rev:2 rq:867939 version:1.4 Changes: -------- --- /work/SRC/openSUSE:Factory/ocaml-num/ocaml-num.changes 2020-03-09 14:14:13.806540060 +0100 +++ /work/SRC/openSUSE:Factory/.ocaml-num.new.12324/ocaml-num.changes 2021-04-29 01:37:15.170480845 +0200 @@ -1,0 +2,7 @@ +Thu Jan 21 21:21:21 UTC 2021 - [email protected] + +- Update to version 1.4 + fix bug caused by unsafe string/bytes conversions, + and remove all uses of Bytes.unsafe_of_string + +------------------------------------------------------------------- Old: ---- ocaml-num-1.3.tar.xz New: ---- ocaml-num-1.4.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ocaml-num.spec ++++++ --- /var/tmp/diff_new_pack.eWuoZJ/_old 2021-04-29 01:37:16.650482943 +0200 +++ /var/tmp/diff_new_pack.eWuoZJ/_new 2021-04-29 01:37:16.650482943 +0200 @@ -1,7 +1,7 @@ # # spec file for package ocaml-num # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,18 +17,17 @@ Name: ocaml-num -Version: 1.3 +Version: 1.4 Release: 0 %{?ocaml_preserve_bytecode} Summary: The legacy Num library License: LGPL-2.1-only WITH OCaml-LGPL-linking-exception Group: Development/Languages/OCaml -Url: https://opam.ocaml.org/packages/num +URL: https://opam.ocaml.org/packages/num Source: %{name}-%{version}.tar.xz BuildRequires: ocaml(ocaml_base_version) >= 4.06 BuildRequires: ocaml-dune -BuildRequires: ocaml-rpm-macros >= 20200220 -BuildRequires: ocamlfind(dune.configurator) +BuildRequires: ocaml-rpm-macros >= 20210121 %description This library implements arbitrary-precision arithmetic on big integers and on rationals. @@ -48,6 +47,7 @@ %autosetup -p1 %build +dune_release_pkgs='num' %ocaml_dune_setup %ocaml_dune_build ++++++ _service ++++++ --- /var/tmp/diff_new_pack.eWuoZJ/_old 2021-04-29 01:37:16.678482982 +0200 +++ /var/tmp/diff_new_pack.eWuoZJ/_new 2021-04-29 01:37:16.678482982 +0200 @@ -1,7 +1,7 @@ <services> <service name="tar_scm" mode="disabled"> <param name="filename">ocaml-num</param> - <param name="revision">0d6586d3b821822133f562ac77dd2c70fed23343</param> + <param name="revision">814c159ea6cebff3b1f61b2055b893be87084ae3</param> <param name="scm">git</param> <param name="submodules">disable</param> <param name="url">https://github.com/ocaml/num.git</param> ++++++ ocaml-num-1.3.tar.xz -> ocaml-num-1.4.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-num-1.3/Changelog new/ocaml-num-1.4/Changelog --- old/ocaml-num-1.3/Changelog 2019-11-20 09:24:08.000000000 +0100 +++ new/ocaml-num-1.4/Changelog 2020-11-09 17:22:09.000000000 +0100 @@ -1,3 +1,8 @@ +Release 1.4 (2020-11-09) + +- Pull request #20: fix bug caused by unsafe string/bytes conversions, + and remove all uses of `Bytes.unsafe_of_string` + Release 1.3 (2019-11-20) - Pull request #16: use Sys.word_size and Sys.int_size more consistently diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-num-1.3/num.opam new/ocaml-num-1.4/num.opam --- old/ocaml-num-1.3/num.opam 2019-11-20 09:24:08.000000000 +0100 +++ new/ocaml-num-1.4/num.opam 2020-11-09 17:22:09.000000000 +0100 @@ -1,5 +1,5 @@ opam-version: "2.0" -version: "1.3" +version: "1.4" maintainer: "Xavier Leroy <[email protected]>" authors: [ "Val??rie M??nissier-Morain" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-num-1.3/src/big_int.ml new/ocaml-num-1.4/src/big_int.ml --- old/ocaml-num-1.3/src/big_int.ml 2019-11-20 09:24:08.000000000 +0100 +++ new/ocaml-num-1.4/src/big_int.ml 2020-11-09 17:22:09.000000000 +0100 @@ -674,7 +674,7 @@ (big_int_of_string "963295986")) (big_int_of_string "100000000")))) in let s = - Bytes.unsafe_of_string + Bytes.of_string (string_of_big_int (div_big_int bi (power_int_positive_int 10 n))) in let (sign, off) = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-num-1.3/src/ratio.ml new/ocaml-num-1.4/src/ratio.ml --- old/ocaml-num-1.3/src/ratio.ml 2019-11-20 09:24:08.000000000 +0100 +++ new/ocaml-num-1.4/src/ratio.ml 2020-11-09 17:22:09.000000000 +0100 @@ -438,13 +438,13 @@ (base_power_big_int 10 (succ n) (abs_big_int r.numerator)) r.denominator)) in + let s1 = Bytes.of_string s1 in (* Round up and add 1 in front if needed *) let s2 = - if round_futur_last_digit (Bytes.unsafe_of_string s1) 0 - (String.length s1) - then "1" ^ s1 + if round_futur_last_digit s1 0 (Bytes.length s1) + then Bytes.cat (Bytes.of_string "1") s1 else s1 in - let l2 = String.length s2 - 1 in + let l2 = Bytes.length s2 - 1 in (* if s2 without last digit is xxxxyyy with n 'yyy' digits: <sign> xxxx . yyy if s2 without last digit is yy with <= n digits: @@ -452,15 +452,15 @@ if l2 > n then begin let s = Bytes.make (l2 + 2) '0' in Bytes.set s 0 (if sign_r = -1 then '-' else '+'); - String.blit s2 0 s 1 (l2 - n); + Bytes.blit s2 0 s 1 (l2 - n); Bytes.set s (l2 - n + 1) '.'; - String.blit s2 (l2 - n) s (l2 - n + 2) n; + Bytes.blit s2 (l2 - n) s (l2 - n + 2) n; Bytes.unsafe_to_string s end else begin let s = Bytes.make (n + 3) '0' in Bytes.set s 0 (if sign_r = -1 then '-' else '+'); Bytes.set s 2 '.'; - String.blit s2 0 s (n + 3 - l2) l2; + Bytes.blit s2 0 s (n + 3 - l2) l2; Bytes.unsafe_to_string s end end else begin @@ -508,8 +508,8 @@ 10 k (abs_big_int r.numerator)) r.denominator) in string_of_nat nat) in - if round_futur_last_digit (Bytes.unsafe_of_string s) 0 - (String.length s) + let s = Bytes.of_string s in + if round_futur_last_digit s 0 (Bytes.length s) then let m = num_decimal_digits_int (succ msd) in let str = Bytes.make (n + m + 4) '0' in @@ -525,7 +525,7 @@ and p = n + 3 in let str = Bytes.make (succ (m + p)) '0' in (String.blit (if sign_r = -1 then "-0." else "+0.") 0 str 0 3); - (String.blit s 0 str 3 n); + (Bytes.blit s 0 str 3 n); Bytes.set str p 'e'; (if m = 0 then Bytes.set str (succ p) '0'
