Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ocaml-pcre for openSUSE:Factory 
checked in at 2021-09-29 20:18:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ocaml-pcre (Old)
 and      /work/SRC/openSUSE:Factory/.ocaml-pcre.new.1899 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ocaml-pcre"

Wed Sep 29 20:18:33 2021 rev:5 rq:921275 version:7.5.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/ocaml-pcre/ocaml-pcre.changes    2020-08-24 
15:09:18.118575313 +0200
+++ /work/SRC/openSUSE:Factory/.ocaml-pcre.new.1899/ocaml-pcre.changes  
2021-09-29 20:19:38.311051468 +0200
@@ -1,0 +2,6 @@
+Sat Sep 11 12:34:56 UTC 2021 - oher...@suse.de
+
+- Update to version 7.5.0
+  Require dune 2.7+
+
+-------------------------------------------------------------------

Old:
----
  ocaml-pcre-7.4.6.tar.xz

New:
----
  ocaml-pcre-7.5.0.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ocaml-pcre.spec ++++++
--- /var/tmp/diff_new_pack.NO71oI/_old  2021-09-29 20:19:38.695052025 +0200
+++ /var/tmp/diff_new_pack.NO71oI/_new  2021-09-29 20:19:38.699052031 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package ocaml-pcre
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
 # Copyright (c) 2011 Andrew Psaltis <ampsaltis at gmail.com>
 #
 # All modifications and additions to the file contributed by third parties
@@ -18,7 +18,7 @@
 
 
 Name:           ocaml-pcre
-Version:        7.4.6
+Version:        7.5.0
 Release:        0
 %{?ocaml_preserve_bytecode}
 Summary:        Perl compatibility regular expressions (PCRE) for OCaml
@@ -26,10 +26,10 @@
 Group:          Development/Languages/OCaml
 URL:            https://opam.ocaml.org/packages/pcre
 Source0:        %{name}-%{version}.tar.xz
-BuildRequires:  ocaml-dune
-BuildRequires:  ocaml-rpm-macros >= 20200514
+BuildRequires:  ocaml-dune >= 2.7
+BuildRequires:  ocaml-rpm-macros >= 20210911
 BuildRequires:  pkg-config
-BuildRequires:  ocaml(ocaml_base_version) >= 4.08
+BuildRequires:  ocaml(ocaml_base_version) >= 4.12
 BuildRequires:  ocamlfind(dune.configurator)
 BuildRequires:  pkgconfig(libpcre)
 

++++++ _service ++++++
--- /var/tmp/diff_new_pack.NO71oI/_old  2021-09-29 20:19:38.727052072 +0200
+++ /var/tmp/diff_new_pack.NO71oI/_new  2021-09-29 20:19:38.727052072 +0200
@@ -1,7 +1,7 @@
 <services>
   <service name="tar_scm" mode="disabled">
     <param name="filename">ocaml-pcre</param>
-    <param name="revision">60fce5301b4e645efb8f8e14994ee055e8f8f781</param>
+    <param name="revision">efdf4840f1a4d8e26f125fa9c18f2a02944e6897</param>
     <param name="scm">git</param>
     <param name="submodules">disable</param>
     <param name="url">git://github.com/mmottl/pcre-ocaml.git</param>

++++++ ocaml-pcre-7.4.6.tar.xz -> ocaml-pcre-7.5.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-pcre-7.4.6/.gitignore 
new/ocaml-pcre-7.5.0/.gitignore
--- old/ocaml-pcre-7.4.6/.gitignore     1970-01-01 01:00:00.000000000 +0100
+++ new/ocaml-pcre-7.5.0/.gitignore     2021-07-22 19:22:32.000000000 +0200
@@ -0,0 +1,4 @@
+.*.swp
+.merlin
+*.install
+_build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-pcre-7.4.6/CHANGES.md 
new/ocaml-pcre-7.5.0/CHANGES.md
--- old/ocaml-pcre-7.4.6/CHANGES.md     2020-08-04 19:34:21.000000000 +0200
+++ new/ocaml-pcre-7.5.0/CHANGES.md     2021-07-22 19:22:32.000000000 +0200
@@ -1,3 +1,11 @@
+### 7.5.0 (2021-07-22)
+
+  * Added support for JIT-compilation of patterns, which can greatly improve
+    matching performance for most patterns.  Users need to explicitly add
+    the `jit_compile` flag to request JIT-compilation when creating regular
+    expressions.
+
+
 ### 7.4.6 (2020-08-04)
 
   * Removed mistakenly kept base library configuration dependency.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-pcre-7.4.6/dune-project 
new/ocaml-pcre-7.5.0/dune-project
--- old/ocaml-pcre-7.4.6/dune-project   2020-08-04 19:34:21.000000000 +0200
+++ new/ocaml-pcre-7.5.0/dune-project   2021-07-22 19:22:32.000000000 +0200
@@ -1,10 +1,10 @@
-(lang dune 1.10)
+(lang dune 2.7)
 (name pcre)
 
 (generate_opam_files true)
 
 (source (github mmottl/pcre-ocaml))
-(license "LGPL-2.1+ with OCaml linking exception")
+(license "LGPL-2.1-or-later with OCaml-LGPL-linking-exception")
 (homepage "https://mmottl.github.io/pcre-ocaml";)
 (documentation "https://mmottl.github.io/pcre-ocaml/api";)
 
@@ -18,8 +18,7 @@
 pcre-ocaml offers library functions for string pattern matching and
 substitution, similar to the functionality offered by the Perl language.")
   (depends
-    (ocaml (>= 4.08))
-    (dune (>= 1.10))
+    (ocaml (>= 4.12))
     dune-configurator
     (conf-libpcre :build)
     base-bytes
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-pcre-7.4.6/examples/dune 
new/ocaml-pcre-7.5.0/examples/dune
--- old/ocaml-pcre-7.4.6/examples/dune  2020-08-04 19:34:21.000000000 +0200
+++ new/ocaml-pcre-7.5.0/examples/dune  2021-07-22 19:22:32.000000000 +0200
@@ -1,4 +1,5 @@
 (executables
   (names cloc count_hash pcregrep subst dfa_restart)
   (libraries pcre)
+  (modes byte exe)
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-pcre-7.4.6/pcre.opam 
new/ocaml-pcre-7.5.0/pcre.opam
--- old/ocaml-pcre-7.4.6/pcre.opam      2020-08-04 19:34:21.000000000 +0200
+++ new/ocaml-pcre-7.5.0/pcre.opam      2021-07-22 19:22:32.000000000 +0200
@@ -1,26 +1,35 @@
 # This file is generated by dune, edit dune-project instead
 opam-version: "2.0"
-build: [
-  ["dune" "subst"] {pinned}
-  ["dune" "build" "-p" name "-j" jobs]
-  ["dune" "runtest" "-p" name "-j" jobs] {with-test}
-  ["dune" "build" "-p" name "@doc"] {with-doc}
-]
-maintainer: ["Markus Mottl <markus.mo...@gmail.com>"]
-authors: ["Markus Mottl <markus.mo...@gmail.com>"]
-bug-reports: "https://github.com/mmottl/pcre-ocaml/issues";
-homepage: "https://mmottl.github.io/pcre-ocaml";
-doc: "https://mmottl.github.io/pcre-ocaml/api";
-license: "LGPL-2.1+ with OCaml linking exception"
-dev-repo: "git+https://github.com/mmottl/pcre-ocaml.git";
 synopsis: "Bindings to the Perl Compatibility Regular Expressions library"
 description: """
 pcre-ocaml offers library functions for string pattern matching and
 substitution, similar to the functionality offered by the Perl language."""
+maintainer: ["Markus Mottl <markus.mo...@gmail.com>"]
+authors: ["Markus Mottl <markus.mo...@gmail.com>"]
+license: "LGPL-2.1-or-later with OCaml-LGPL-linking-exception"
+homepage: "https://mmottl.github.io/pcre-ocaml";
+doc: "https://mmottl.github.io/pcre-ocaml/api";
+bug-reports: "https://github.com/mmottl/pcre-ocaml/issues";
 depends: [
-  "ocaml" {>= "4.08"}
-  "dune" {>= "1.10"}
+  "dune" {>= "2.7"}
+  "ocaml" {>= "4.12"}
   "dune-configurator"
   "conf-libpcre" {build}
   "base-bytes"
+  "odoc" {with-doc}
+]
+build: [
+  ["dune" "subst"] {dev}
+  [
+    "dune"
+    "build"
+    "-p"
+    name
+    "-j"
+    jobs
+    "@install"
+    "@runtest" {with-test}
+    "@doc" {with-doc}
+  ]
 ]
+dev-repo: "git+https://github.com/mmottl/pcre-ocaml.git";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-pcre-7.4.6/src/config/dune 
new/ocaml-pcre-7.5.0/src/config/dune
--- old/ocaml-pcre-7.4.6/src/config/dune        2020-08-04 19:34:21.000000000 
+0200
+++ new/ocaml-pcre-7.5.0/src/config/dune        2021-07-22 19:22:32.000000000 
+0200
@@ -1,4 +1,5 @@
 (executables
   (names discover)
   (libraries dune.configurator)
+  (modes byte exe)
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-pcre-7.4.6/src/dune 
new/ocaml-pcre-7.5.0/src/dune
--- old/ocaml-pcre-7.4.6/src/dune       2020-08-04 19:34:21.000000000 +0200
+++ new/ocaml-pcre-7.5.0/src/dune       2021-07-22 19:22:32.000000000 +0200
@@ -1,12 +1,12 @@
 (library
   (public_name pcre)
-  (c_names pcre_stubs)
-  (c_flags (:standard) (:include c_flags.sexp) -O2 -fPIC -DPIC)
+  (foreign_stubs
+    (language c)
+    (names pcre_stubs)
+    (flags (:standard) (:include c_flags.sexp) -O2 -fPIC -DPIC))
   (c_library_flags (:include c_library_flags.sexp))
 )
 
 (rule
   (targets c_flags.sexp c_library_flags.sexp)
-  (deps (:discover config/discover.exe))
-  (action (run %{discover}))
-)
+  (action (run ./config/discover.exe)))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-pcre-7.4.6/src/pcre.ml 
new/ocaml-pcre-7.5.0/src/pcre.ml
--- old/ocaml-pcre-7.4.6/src/pcre.ml    2020-08-04 19:34:21.000000000 +0200
+++ new/ocaml-pcre-7.5.0/src/pcre.ml    2021-07-22 19:22:32.000000000 +0200
@@ -242,7 +242,7 @@
 external maketables : unit -> chtables = "pcre_maketables_stub"
 
 (*  Internal use only! *)
-external pcre_study : regexp -> unit = "pcre_study_stub"
+external pcre_study : regexp -> jit_compile : bool -> unit = "pcre_study_stub"
 
 external compile : (icflag  [@untagged]) -> chtables option -> string -> regexp
   = "pcre_compile_stub_bc" "pcre_compile_stub"
@@ -265,14 +265,16 @@
   [@@noalloc]
 
 let regexp
-      ?(study = true) ?limit ?limit_recursion
+      ?(study = true)
+      ?(jit_compile = false)
+      ?limit ?limit_recursion
       ?(iflags = 0) ?flags ?chtables pat =
   let rex =
     match flags with
     | Some flag_list -> compile (cflags flag_list) chtables pat
     | _ -> compile iflags chtables pat
   in
-  if study then pcre_study rex;
+  if study then pcre_study ~jit_compile rex;
   let rex =
     match limit with
     | None -> rex
@@ -283,7 +285,8 @@
   | Some lim -> set_imp_match_limit_recursion rex lim
 
 let regexp_or
-      ?study ?limit ?limit_recursion ?(iflags = 0) ?flags ?chtables pats =
+      ?study ?jit_compile ?limit ?limit_recursion ?(iflags = 0)
+      ?flags ?chtables pats =
   let check pat =
     try ignore (regexp ~study:false ~iflags ?flags ?chtables pat)
     with Error error -> raise (Regexp_or (pat, error))
@@ -293,7 +296,8 @@
     let cnv pat = "(?:" ^ pat ^ ")" in
     String.concat "|" (List.rev (List.rev_map cnv pats))
   in
-  regexp ?study ?limit ?limit_recursion ~iflags ?flags ?chtables big_pat
+  regexp ?study ?jit_compile ?limit ?limit_recursion ~iflags ?flags ?chtables
+    big_pat
 
 let bytes_unsafe_blit_string str str_ofs bts bts_ofs len =
   let str_bts = Bytes.unsafe_of_string str in
@@ -324,7 +328,7 @@
 (* Matching of patterns and subpattern extraction *)
 
 (* Default regular expression when none is provided by the user *)
-let def_rex = regexp "\\s+"
+let def_rex = regexp ~jit_compile:true "\\s+"
 
 type substrings = string * int array
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-pcre-7.4.6/src/pcre.mli 
new/ocaml-pcre-7.5.0/src/pcre.mli
--- old/ocaml-pcre-7.4.6/src/pcre.mli   2020-08-04 19:34:21.000000000 +0200
+++ new/ocaml-pcre-7.5.0/src/pcre.mli   2021-07-22 19:22:32.000000000 +0200
@@ -231,21 +231,24 @@
 
 val regexp :
   ?study : bool ->
+  ?jit_compile : bool ->
   ?limit : int ->
   ?limit_recursion : int ->
   ?iflags : icflag ->
   ?flags : cflag list ->
   ?chtables : chtables ->
   string -> regexp
-(** [regexp ?study ?limit ?limit_recursion ?iflags ?flags ?chtables pattern]
-    compiles [pattern] with [flags] when given, with [iflags] otherwise, and
-    with char tables [chtables]. If [study] is true, then the resulting regular
-    expression will be studied. If [limit] is specified, this sets a limit to
-    the amount of recursion and backtracking (only lower than the builtin
-    default!). If this limit is exceeded, [MatchLimit] will be raised during
-    matching.
+(** [regexp ?jit_compile ?study ?limit ?limit_recursion ?iflags ?flags
+    ?chtables pattern] compiles [pattern] with [flags] when given, with
+    [iflags] otherwise, and with char tables [chtables].  If [study] is true,
+    then the resulting regular expression will be studied.  If [jit_compile]
+    is true, studying will also perform JIT-compilation of the pattern.
+    [If [limit] is specified, this sets a limit to the amount of recursion
+    and backtracking (only lower than the builtin default!).  If this limit
+    is exceeded, [MatchLimit] will be raised during matching.
 
     @param study default = true
+    @param jit_compile default = false
     @param limit default = no extra limit other than default
     @param limit_recursion default = no extra limit_recursion other than 
default
     @param iflags default = no extra flags
@@ -261,6 +264,7 @@
 
 val regexp_or :
   ?study : bool ->
+  ?jit_compile : bool ->
   ?limit : int ->
   ?limit_recursion : int ->
   ?iflags : icflag ->
@@ -269,7 +273,8 @@
   string list -> regexp
 (** [regexp_or ?study ?limit ?limit_recursion ?iflags ?flags ?chtables 
patterns]
     like {!regexp}, but combines [patterns] as alternatives (or-patterns) into
-    one regular expression. *)
+    one regular expression.
+*)
 
 val quote : string -> string
 (** [quote str] @return the quoted string of [str]. *)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ocaml-pcre-7.4.6/src/pcre_stubs.c 
new/ocaml-pcre-7.5.0/src/pcre_stubs.c
--- old/ocaml-pcre-7.4.6/src/pcre_stubs.c       2020-08-04 19:34:21.000000000 
+0200
+++ new/ocaml-pcre-7.5.0/src/pcre_stubs.c       2021-07-22 19:22:32.000000000 
+0200
@@ -56,13 +56,18 @@
 
 /* Error codes as defined for pcre 7.9, undefined in pcre 4.5 */
 #ifndef PCRE_ERROR_PARTIAL
-#define PCRE_ERROR_PARTIAL        (-12)
+# define PCRE_ERROR_PARTIAL        (-12)
 #endif
 #ifndef PCRE_ERROR_BADPARTIAL
-#define PCRE_ERROR_BADPARTIAL     (-13)
+# define PCRE_ERROR_BADPARTIAL     (-13)
 #endif
 #ifndef PCRE_ERROR_RECURSIONLIMIT
-#define PCRE_ERROR_RECURSIONLIMIT (-21)
+# define PCRE_ERROR_RECURSIONLIMIT (-21)
+#endif
+
+/* Make sure to define JIT-compilation flag appropriately if unsupported */
+#ifndef PCRE_STUDY_JIT_COMPILE
+# define PCRE_STUDY_JIT_COMPILE 0
 #endif
 
 typedef const unsigned char *chartables;  /* Type of chartable sets */
@@ -87,8 +92,6 @@
 static value var_Studied;      /* Variant [`Studied] */
 static value var_Optimal;      /* Variant [`Optimal] */
 
-static value None = Val_int(0);
-
 /* Data associated with OCaml values of PCRE regular expression */
 struct pcre_ocaml_regexp { pcre *rex; pcre_extra *extra; int studied; };
 
@@ -321,8 +324,7 @@
 
   /* If v_tables = [None], then pointer to tables is NULL, otherwise
      set it to the appropriate value */
-  chartables tables =
-    (v_tables == None) ? NULL : get_tables(Field(v_tables, 0));
+  chartables tables = Is_none(v_tables) ? NULL : get_tables(Field(v_tables, 
0));
 
   /* Compiles the pattern */
   pcre *regexp = pcre_compile(String_val(v_pat), v_opt, &error,
@@ -354,12 +356,13 @@
 
 
 /* Studies a regexp */
-CAMLprim value pcre_study_stub(value v_rex)
+CAMLprim value pcre_study_stub(value v_rex, value v_jit_compile)
 {
   /* If it has not yet been studied */
   if (! get_studied(v_rex)) {
     const char *error = NULL;
-    pcre_extra *extra = pcre_study(get_rex(v_rex), 0, &error);
+    int flags = Bool_val(v_jit_compile) ? PCRE_STUDY_JIT_COMPILE : 0;
+    pcre_extra *extra = pcre_study(get_rex(v_rex), flags, &error);
     if (error != NULL) caml_invalid_argument((char *) error);
     set_extra(v_rex, extra);
     set_studied(v_rex, 1);
@@ -372,28 +375,28 @@
 CAMLprim value pcre_get_match_limit_recursion_stub(value v_rex)
 {
   pcre_extra *extra = get_extra(v_rex);
-  if (extra == NULL) return None;
+  if (extra == NULL) return Val_none;
   if (extra->flags & PCRE_EXTRA_MATCH_LIMIT_RECURSION) {
     value v_lim = Val_int(extra->match_limit_recursion);
     value v_res = caml_alloc_small(1, 0);
     Field(v_res, 0) = v_lim;
     return v_res;
   }
-  return None;
+  return Val_none;
 }
 
 /* Gets the match limit of a regular expression if it exists */
 CAMLprim value pcre_get_match_limit_stub(value v_rex)
 {
   pcre_extra *extra = get_extra(v_rex);
-  if (extra == NULL) return None;
+  if (extra == NULL) return Val_none;
   if (extra->flags & PCRE_EXTRA_MATCH_LIMIT) {
     value v_lim = Val_int(extra->match_limit);
     value v_res = caml_alloc_small(1, 0);
     Field(v_res, 0) = v_lim;
     return v_res;
   }
-  return None;
+  return Val_none;
 }
 
 
@@ -501,48 +504,25 @@
 
 CAMLprim value pcre_firsttable_stub(value v_rex)
 {
+  CAMLparam1(v_rex);
   const unsigned char *ftable;
-
-  int ret =
-    pcre_fullinfo_stub(v_rex, PCRE_INFO_FIRSTTABLE, (void *) &ftable);
-
+  int ret = pcre_fullinfo_stub(v_rex, PCRE_INFO_FIRSTTABLE, (void *) &ftable);
   if (ret != 0) raise_internal_error("pcre_firsttable_stub");
-
-  if (ftable == NULL) return None;
-  else {
-    value v_res, v_res_str;
-
-    Begin_roots1(v_rex);
-      v_res_str = caml_alloc_initialized_string(32, (char *) ftable);
-    End_roots();
-
-    Begin_roots1(v_res_str);
-      /* Allocates [Some string] from firsttable */
-      v_res = caml_alloc_small(1, 0);
-    End_roots();
-
-    Field(v_res, 0) = v_res_str;
-
-    return v_res;
-  }
+  CAMLreturn(
+    (ftable == NULL)
+    ? Val_none
+    : caml_alloc_some(caml_alloc_initialized_string(32, (char *) ftable)));
 }
 
 CAMLprim value pcre_lastliteral_stub(value v_rex)
 {
   int lastliteral;
-  const int ret = pcre_fullinfo_stub(v_rex, PCRE_INFO_LASTLITERAL,
-                                        &lastliteral);
-
+  const int ret =
+    pcre_fullinfo_stub(v_rex, PCRE_INFO_LASTLITERAL, &lastliteral);
   if (ret != 0) raise_internal_error("pcre_lastliteral_stub");
-
-  if (lastliteral == -1) return None;
+  if (lastliteral == -1) return Val_none;
   if (lastliteral < 0) raise_internal_error("pcre_lastliteral_stub");
-  else {
-    /* Allocates [Some char] */
-    value v_res = caml_alloc_small(1, 0);
-    Field(v_res, 0) = Val_int(lastliteral);
-    return v_res;
-  }
+  else return caml_alloc_some(Val_int(lastliteral));
 }
 
 CAMLprim value pcre_study_stat_stub(value v_rex)
@@ -627,7 +607,7 @@
     const int opt = v_opt;  /* Runtime options */
 
     /* Special case when no callout functions specified */
-    if (v_maybe_cof == None) {
+    if (Is_none(v_maybe_cof)) {
       int *ovec = (int *) &Field(v_ovec, 0);
 
       /* Performs the match */
@@ -812,7 +792,7 @@
 /* Returns array of names of named substrings in a regexp */
 CAMLprim value pcre_names_stub(value v_rex)
 {
-  CAMLparam0();
+  CAMLparam1(v_rex);
   CAMLlocal1(v_res);
   int name_count;
   int entry_size;

Reply via email to