pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/ocsigen Switched www/ocsigenserver to use ocaml-xm...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/52b85b7f0244
branches:  trunk
changeset: 388003:52b85b7f0244
user:      jaapb <jaapb%pkgsrc.org@localhost>
date:      Thu Nov 29 10:54:14 2018 +0000

description:
Switched www/ocsigenserver to use ocaml-xml-light parser

This is a patch from upstream, applied before release as the new version
of tyxml already removed the parser from distribution.

diffstat:

 www/ocsigen/Makefile                                                       |    5 +-
 www/ocsigen/distinfo                                                       |   34 +-
 www/ocsigen/patches/patch-Makefile.options                                 |   12 +-
 www/ocsigen/patches/patch-configure                                        |   13 +-
 www/ocsigen/patches/patch-src_extensions_Makefile                          |    5 +-
 www/ocsigen/patches/patch-src_extensions_accesscontrol.ml                  |  259 ++++++++++
 www/ocsigen/patches/patch-src_extensions_accesscontrol.mli                 |   11 +
 www/ocsigen/patches/patch-src_extensions_authbasic.ml                      |   23 +
 www/ocsigen/patches/patch-src_extensions_authbasic.mli                     |   23 +
 www/ocsigen/patches/patch-src_extensions_cgimod.ml                         |   46 +-
 www/ocsigen/patches/patch-src_extensions_deflatemod.ml                     |   38 +
 www/ocsigen/patches/patch-src_extensions_extendconfiguration.ml            |  161 ++++++
 www/ocsigen/patches/patch-src_extensions_extensiontemplate.ml              |   42 +
 www/ocsigen/patches/patch-src_extensions_ocsipersist-dbm_Makefile          |   14 +
 www/ocsigen/patches/patch-src_extensions_ocsipersist-dbm_ocsipersist.ml    |   36 +
 www/ocsigen/patches/patch-src_extensions_ocsipersist-pgsql_Makefile        |    5 +-
 www/ocsigen/patches/patch-src_extensions_ocsipersist-pgsql_ocsipersist.ml  |   18 +
 www/ocsigen/patches/patch-src_extensions_ocsipersist-sqlite_Makefile       |    6 +-
 www/ocsigen/patches/patch-src_extensions_ocsipersist-sqlite_ocsipersist.ml |   18 +
 www/ocsigen/patches/patch-src_extensions_revproxy.ml                       |   13 +
 www/ocsigen/patches/patch-src_extensions_rewritemod.ml                     |   13 +
 www/ocsigen/patches/patch-src_extensions_userconf.ml                       |   24 +
 www/ocsigen/patches/patch-src_server_ocsigen__extensions.ml                |  104 ++++
 www/ocsigen/patches/patch-src_server_ocsigen__extensions.mli               |   72 ++
 www/ocsigen/patches/patch-src_server_ocsigen__parseconfig.ml               |   51 +
 www/ocsigen/patches/patch-src_server_ocsigen__parseconfig.mli              |   48 +
 www/ocsigen/patches/patch-src_server_ocsigen__server.ml                    |   21 +-
 27 files changed, 1089 insertions(+), 26 deletions(-)

diffs (truncated from 1343 to 300 lines):

diff -r 8d144079791c -r 52b85b7f0244 www/ocsigen/Makefile
--- a/www/ocsigen/Makefile      Thu Nov 29 10:51:34 2018 +0000
+++ b/www/ocsigen/Makefile      Thu Nov 29 10:54:14 2018 +0000
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.33 2018/11/12 16:10:29 jaapb Exp $
+# $NetBSD: Makefile,v 1.34 2018/11/29 10:54:14 jaapb Exp $
 #
 
 VERSION=       2.9
 GITHUB_PROJECT=        ocsigenserver
 PKGNAME=       ocsigen-${VERSION}
-PKGREVISION=   3
+PKGREVISION=   4
 DISTNAME=      ${GITHUB_PROJECT}-${VERSION}
 CATEGORIES=    www
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=ocsigen/}
@@ -81,4 +81,5 @@
 .include "../../security/ocaml-cryptokit/buildlink3.mk"
 .include "../../security/ocaml-ssl/buildlink3.mk"
 .include "../../textproc/ocaml-tyxml/buildlink3.mk"
+.include "../../textproc/ocaml-xml-light/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r 8d144079791c -r 52b85b7f0244 www/ocsigen/distinfo
--- a/www/ocsigen/distinfo      Thu Nov 29 10:51:34 2018 +0000
+++ b/www/ocsigen/distinfo      Thu Nov 29 10:54:14 2018 +0000
@@ -1,19 +1,37 @@
-$NetBSD: distinfo,v 1.11 2018/04/13 13:15:00 jaapb Exp $
+$NetBSD: distinfo,v 1.12 2018/11/29 10:54:14 jaapb Exp $
 
 SHA1 (ocsigenserver-2.9.tar.gz) = 1b4d50c9b6fff3ab78c8aef3ebbde1f8ddcc594e
 RMD160 (ocsigenserver-2.9.tar.gz) = f5114a7bda3327e279f57f40336a7c23e19b66ce
 SHA512 (ocsigenserver-2.9.tar.gz) = b3c5a86785feac18bac677ebb3736705f5d015a8692d2811bf22009dc319636e8b7bbb54dfd0223b2040a8f8bdef5ca3336d903b5ecd7eb260e8c0d48946ee46
 Size (ocsigenserver-2.9.tar.gz) = 1265175 bytes
 SHA1 (patch-Makefile) = 637a45aacd7c8afaeb73be624eb7732b21e78b4d
-SHA1 (patch-Makefile.options) = 6b59e2d20cc0a47c56a9b11cba56cd70d7dc9beb
-SHA1 (patch-configure) = 9b1c5c373e36169eb1b86daba0f9214845513082
+SHA1 (patch-Makefile.options) = 3e88ca4a0d04e01a4cb61e88aaec1b013ff0de5e
+SHA1 (patch-configure) = ed7a047081dfd233b95d4c25cb5832cb65bbcb11
 SHA1 (patch-src_baselib_Makefile) = e2fd5e5bd933d4ec844713c8f574efd5fa8426cf
 SHA1 (patch-src_baselib_ocsigen__stream.ml) = 6907fd8f7e0295f5147a0f2322cb1bec28f73953
-SHA1 (patch-src_extensions_Makefile) = 5f3af59550f5b576e39323b7cd1252ee70fd282b
-SHA1 (patch-src_extensions_cgimod.ml) = 6f5093a1a93a5797ce47c33b9704e45f8aa6c2c5
-SHA1 (patch-src_extensions_ocsipersist-pgsql_Makefile) = 223b8f652ccd4144fbe3c0f67c6fdd3cdf6fa0aa
-SHA1 (patch-src_extensions_ocsipersist-sqlite_Makefile) = 916733e0732ec58f502aeee5769fde1ed7060a9f
+SHA1 (patch-src_extensions_Makefile) = 1dc200d1bd7a55424830acc5e79140e5e996c762
+SHA1 (patch-src_extensions_accesscontrol.ml) = a02101ea97747bb139f72413eb4f4a9ee738692e
+SHA1 (patch-src_extensions_accesscontrol.mli) = 19a67e7e43a9411616d8893d2886e4f048a107d8
+SHA1 (patch-src_extensions_authbasic.ml) = 8179c77352d52965d17c98d0ea3454cb3ff6e090
+SHA1 (patch-src_extensions_authbasic.mli) = 718c05392e48579a72b251a5966933b39bb7eff2
+SHA1 (patch-src_extensions_cgimod.ml) = ba572df1ab27f3e090bc1a1e032c1430113995ed
+SHA1 (patch-src_extensions_deflatemod.ml) = 16a4bb7a048930053120636f474297ff3c78d471
+SHA1 (patch-src_extensions_extendconfiguration.ml) = beb1a298427ea0d4c19326f29503eee7bd6b3dcb
+SHA1 (patch-src_extensions_extensiontemplate.ml) = 805bf033a8fc7a1ecd3532411b2defdb82eeaad4
+SHA1 (patch-src_extensions_ocsipersist-dbm_Makefile) = 2b73b0fa5594bc0542393e005d2979737a28d9bc
+SHA1 (patch-src_extensions_ocsipersist-dbm_ocsipersist.ml) = f747c7e54f23cf29fabbe972e6f5e43c952ce1d1
+SHA1 (patch-src_extensions_ocsipersist-pgsql_Makefile) = e3fa0e4691aa098826b93e67503a9116b28e5efb
+SHA1 (patch-src_extensions_ocsipersist-pgsql_ocsipersist.ml) = 3984d34c71965a2e0d02bf5da547b437911d7f38
+SHA1 (patch-src_extensions_ocsipersist-sqlite_Makefile) = 30bf60665d816ddb5cf1320ae5fdb51d7a50cb86
+SHA1 (patch-src_extensions_ocsipersist-sqlite_ocsipersist.ml) = 8a227e10de4fd5cec0f2f1b8b8aa88578d69056e
+SHA1 (patch-src_extensions_revproxy.ml) = e834ef862baed57310e3fe710905904298a3ac1d
+SHA1 (patch-src_extensions_rewritemod.ml) = cac9b8d6fa815bc2098de9eb5c6346c8d4a795f4
+SHA1 (patch-src_extensions_userconf.ml) = 8d62d77f760ee1027794698f88fc4e4da2de3eeb
 SHA1 (patch-src_http_Makefile) = 1bcfe69470fe53a8fc9b197fd95d21889646909d
 SHA1 (patch-src_http_ocsigen__http__com.mli) = f1760bf423e8aae763992e57c13408aa01c6316f
 SHA1 (patch-src_server_Makefile) = 0f315fb0533d3d0b8f8cf1f3a61e11b013571b05
-SHA1 (patch-src_server_ocsigen__server.ml) = 17b9fc720d01e27a49576864a9d91c87deda85e3
+SHA1 (patch-src_server_ocsigen__extensions.ml) = 7da60f1c1fc2c2370eac93829380cb108f40b2db
+SHA1 (patch-src_server_ocsigen__extensions.mli) = c2c426d96446292dd850b23b7feb9d93d1b5590a
+SHA1 (patch-src_server_ocsigen__parseconfig.ml) = b4a088c5cd3addb70dc4fa9a023878056fc9d1d1
+SHA1 (patch-src_server_ocsigen__parseconfig.mli) = 2b4b091a91efa1bf99e861c82d7d971845947bf9
+SHA1 (patch-src_server_ocsigen__server.ml) = 93c4dac4be34e68c65cf0814eb58954abcc31b1b
diff -r 8d144079791c -r 52b85b7f0244 www/ocsigen/patches/patch-Makefile.options
--- a/www/ocsigen/patches/patch-Makefile.options        Thu Nov 29 10:51:34 2018 +0000
+++ b/www/ocsigen/patches/patch-Makefile.options        Thu Nov 29 10:54:14 2018 +0000
@@ -1,6 +1,7 @@
-$NetBSD: patch-Makefile.options,v 1.4 2018/04/13 13:15:00 jaapb Exp $
+$NetBSD: patch-Makefile.options,v 1.5 2018/11/29 10:54:14 jaapb Exp $
 
 Support for preemptive threads is in lwt.unix now
+Replace tyxml.parser with xml-light (patch from upstream)
 --- Makefile.options.orig      2018-02-01 12:55:17.000000000 +0000
 +++ Makefile.options
 @@ -25,7 +25,7 @@ endif
@@ -12,3 +13,12 @@
  endif
  
  BASE_PACKAGE := lwt ipaddr bytes
+@@ -39,7 +39,7 @@ SERVER_PACKAGE := lwt_ssl           \
+                   findlib           \
+                 cryptokit         \
+                 tyxml             \
+-                tyxml.parser      \
++                xml-light      \
+                   dynlink           \
+ 
+ INITPACKAGE := \"$(shell ${OCAMLFIND} query -p-format -recursive        \
diff -r 8d144079791c -r 52b85b7f0244 www/ocsigen/patches/patch-configure
--- a/www/ocsigen/patches/patch-configure       Thu Nov 29 10:51:34 2018 +0000
+++ b/www/ocsigen/patches/patch-configure       Thu Nov 29 10:54:14 2018 +0000
@@ -1,6 +1,7 @@
-$NetBSD: patch-configure,v 1.2 2018/04/13 13:15:00 jaapb Exp $
+$NetBSD: patch-configure,v 1.3 2018/11/29 10:54:14 jaapb Exp $
 
 Support for preemptive threads is in lwt.unix now
+Replace tyxml.parser with xml-light (patch from upstream)
 --- configure.orig     2018-02-01 12:55:17.000000000 +0000
 +++ configure
 @@ -412,7 +412,7 @@ check_library lwt "See: http://ocsigen.o
@@ -12,7 +13,15 @@
  
  check_library netstring \
      "See ocamlnet: http://projects.camlcity.org/projects/ocamlnet.html";
-@@ -464,10 +464,10 @@ fi
+@@ -425,6 +425,7 @@ check_library pcre "See: http://ocaml.in
+ check_library cryptokit "See: http://pauillac.inria.fr/~xleroy/software.html#cryptokit";
+ 
+ check_library tyxml "See: http://ocsigen.org/tyxml/";
++check_library xml-light "See: https://github.com/ncannasse/xml-light";
+ 
+ # Check PostgreSQL
+ case "$with_pgsql" in
+@@ -464,10 +465,10 @@ fi
  
  # Check Lwt.preemptive
  if [ "$with_preempt" -gt 0 ]; then
diff -r 8d144079791c -r 52b85b7f0244 www/ocsigen/patches/patch-src_extensions_Makefile
--- a/www/ocsigen/patches/patch-src_extensions_Makefile Thu Nov 29 10:51:34 2018 +0000
+++ b/www/ocsigen/patches/patch-src_extensions_Makefile Thu Nov 29 10:54:14 2018 +0000
@@ -1,6 +1,7 @@
-$NetBSD: patch-src_extensions_Makefile,v 1.4 2018/04/13 13:15:00 jaapb Exp $
+$NetBSD: patch-src_extensions_Makefile,v 1.5 2018/11/29 10:54:14 jaapb Exp $
 
 The lwt_log package has been separated from lwt
+Replace tyxml.parser with xml-light (patch from upstream)
 --- src/extensions/Makefile.orig       2018-02-01 12:55:17.000000000 +0000
 +++ src/extensions/Makefile
 @@ -8,7 +8,8 @@ PACKAGE  :=            \
@@ -8,7 +9,7 @@
        netstring       \
        netstring-pcre  \
 -      tyxml.parser
-+      tyxml.parser \
++      xml-light \
 +      lwt_log
  
  LIBS     := -I ../baselib -I ../http -I ../server ${addprefix -package ,${PACKAGE}}
diff -r 8d144079791c -r 52b85b7f0244 www/ocsigen/patches/patch-src_extensions_accesscontrol.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/ocsigen/patches/patch-src_extensions_accesscontrol.ml Thu Nov 29 10:54:14 2018 +0000
@@ -0,0 +1,259 @@
+$NetBSD: patch-src_extensions_accesscontrol.ml,v 1.1 2018/11/29 10:54:14 jaapb Exp $
+
+Replace tyxml.parser with xml-light (patch from upstream)
+--- src/extensions/accesscontrol.ml.orig       2018-02-01 12:55:17.000000000 +0000
++++ src/extensions/accesscontrol.ml
+@@ -32,7 +32,6 @@ open Ocsigen_lib
+ open Printf
+ open Lwt
+ open Ocsigen_extensions
+-open Simplexmlparser
+ open Ocsigen_http_frame
+ 
+ 
+@@ -43,7 +42,7 @@ let section = Lwt_log.Section.make "ocsi
+ 
+ let rec parse_condition = function
+ 
+-    | Element ("ip", ["value", s], []) ->
++    | Xml.Element ("ip", ["value", s], []) ->
+         let prefix =
+           try
+             Ipaddr.Prefix.of_string_exn s
+@@ -67,9 +66,9 @@ let rec parse_condition = function
+                "IP: %a does not match %s"
+                (fun () -> Ocsigen_request_info.remote_ip) ri s;
+            r)
+-    | Element ("ip" as s, _, _) -> badconfig "Bad syntax for tag %s" s
++    | Xml.Element ("ip" as s, _, _) -> badconfig "Bad syntax for tag %s" s
+ 
+-    | Element ("port", ["value", s], []) ->
++    | Xml.Element ("port", ["value", s], []) ->
+         let port =
+           try
+             int_of_string s
+@@ -87,9 +86,9 @@ let rec parse_condition = function
+                (fun () ri -> string_of_int (Ocsigen_request_info.server_port ri))
+                ri port;
+            r)
+-    | Element ("port" as s, _, _) -> badconfig "Bad syntax for tag %s" s
++    | Xml.Element ("port" as s, _, _) -> badconfig "Bad syntax for tag %s" s
+ 
+-    | Element ("ssl", [], []) ->
++    | Xml.Element ("ssl", [], []) ->
+         (fun ri ->
+            let r = Ocsigen_request_info.ssl ri in
+            if r then
+@@ -97,9 +96,9 @@ let rec parse_condition = function
+            else
+              Lwt_log.ign_info ~section "SSL: not accepted";
+            r)
+-    | Element ("ssl" as s, _, _) -> badconfig "Bad syntax for tag %s" s
++    | Xml.Element ("ssl" as s, _, _) -> badconfig "Bad syntax for tag %s" s
+ 
+-    | Element ("header", ["name", name; "regexp", reg], []) ->
++    | Xml.Element ("header", ["name", name; "regexp", reg], []) ->
+         let regexp =
+           try
+             Netstring_pcre.regexp ("^"^reg^"$")
+@@ -126,9 +125,9 @@ let rec parse_condition = function
+            if not r
+            then Lwt_log.ign_info_f "HEADER: header %s does not match %S" name reg;
+            r)
+-    | Element ("header" as s, _, _) -> badconfig "Bad syntax for tag %s" s
++    | Xml.Element ("header" as s, _, _) -> badconfig "Bad syntax for tag %s" s
+ 
+-    | Element ("method", ["value", s], []) ->
++    | Xml.Element ("method", ["value", s], []) ->
+         let meth =
+           try
+             Framepp.method_of_string s
+@@ -146,9 +145,9 @@ let rec parse_condition = function
+                "METHOD: %a does not match %s"
+               (fun () ri -> Framepp.string_of_method (Ocsigen_request_info.meth ri)) ri s;
+            r)
+-    | Element ("method" as s, _, _) -> badconfig "Bad syntax for tag %s" s
++    | Xml.Element ("method" as s, _, _) -> badconfig "Bad syntax for tag %s" s
+ 
+-    | Element ("protocol", ["value", s], []) ->
++    | Xml.Element ("protocol", ["value", s], []) ->
+         let pr =
+           try
+             Framepp.proto_of_string s
+@@ -166,9 +165,9 @@ let rec parse_condition = function
+                "PROTOCOL: %a does not match %s"
+                (fun () ri -> Framepp.string_of_proto (Ocsigen_request_info.protocol ri)) ri s;
+            r)
+-    | Element ("protocol" as s, _, _) -> badconfig "Bad syntax for tag %s" s
++    | Xml.Element ("protocol" as s, _, _) -> badconfig "Bad syntax for tag %s" s
+ 
+-    | Element ("path", ["regexp", s], []) ->
++    | Xml.Element ("path", ["regexp", s], []) ->
+         let regexp =
+           try
+             Netstring_pcre.regexp ("^"^s^"$")
+@@ -189,22 +188,22 @@ let rec parse_condition = function
+                "PATH: \"%a\" does not match %S"
+                (fun () ri -> Ocsigen_request_info.sub_path_string ri) ri s;
+            r)
+-    | Element ("path" as s, _, _) -> badconfig "Bad syntax for tag %s" s
++    | Xml.Element ("path" as s, _, _) -> badconfig "Bad syntax for tag %s" s
+ 
+-    | Element ("and", [], sub) ->
++    | Xml.Element ("and", [], sub) ->
+         let sub = List.map parse_condition sub in
+         (fun ri -> List.for_all (fun cond -> cond ri) sub)
+-    | Element ("and" as s, _, _) -> badconfig "Bad syntax for tag %s" s
++    | Xml.Element ("and" as s, _, _) -> badconfig "Bad syntax for tag %s" s
+ 
+-    | Element ("or", [], sub) ->
++    | Xml.Element ("or", [], sub) ->
+         let sub = List.map parse_condition sub in
+         (fun ri -> List.exists (fun cond -> cond ri) sub)
+-    | Element ("or" as s, _, _) -> badconfig "Bad syntax for tag %s" s
++    | Xml.Element ("or" as s, _, _) -> badconfig "Bad syntax for tag %s" s
+ 
+-    | Element ("not", [], [sub]) ->
++    | Xml.Element ("not", [], [sub]) ->
+         let sub = parse_condition sub in
+         (fun ri -> not (sub ri))
+-    | Element ("not" as s, _, _) -> badconfig "Bad syntax for tag %s" s
++    | Xml.Element ("not" as s, _, _) -> badconfig "Bad syntax for tag %s" s
+ 
+     | _ ->
+         badconfig "Bad syntax for condition"
+@@ -217,17 +216,17 @@ let comma_space_regexp = Netstring_pcre.
+ 
+ let parse_config parse_fun = function
+ 
+-  | Element ("if", [], sub) ->
++  | Xml.Element ("if", [], sub) ->
+       let (condition, sub) = match sub with
+         | cond::q -> (parse_condition cond, q)
+         | _ -> badconfig "Bad condition in <if>"
+       in
+       let (ithen, sub) = match sub with
+-          | Element("then", [], ithen)::q -> (parse_fun ithen, q)
++          | Xml.Element("then", [], ithen)::q -> (parse_fun ithen, q)
+           | _ -> badconfig "Bad <then> branch in <if>"
+       in
+       let (ielse, sub) = match sub with
+-          | Element ("else", [], ielse)::([] as q) -> (parse_fun ielse, q)
++          | Xml.Element ("else", [], ielse)::([] as q) -> (parse_fun ielse, q)
+           | [] -> (parse_fun [], [])
+           | _ -> badconfig "Bad <else> branch in <if>"
+       in
+@@ -243,17 +242,17 @@ let parse_config parse_fun = function
+                  Lwt_log.ign_info ~section "COND: going into <else> branch, if any";
+                  Ocsigen_extensions.Ext_sub_result ielse
+                end))
+-  | Element ("if" as s, _, _) -> badconfig "Bad syntax for tag %s" s



Home | Main Index | Thread Index | Old Index