Revision: 38736 http://trac.macosforge.org/projects/macports/changeset/38736 Author: landonf@macports.org Date: 2008-07-29 14:43:58 -0700 (Tue, 29 Jul 2008) Log Message: ----------- OCaml DBI library Added Paths: ----------- trunk/dports/devel/caml-ocamldbi/ trunk/dports/devel/caml-ocamldbi/Portfile trunk/dports/devel/caml-ocamldbi/files/ trunk/dports/devel/caml-ocamldbi/files/patch-postgresql.ml Added: trunk/dports/devel/caml-ocamldbi/Portfile =================================================================== --- trunk/dports/devel/caml-ocamldbi/Portfile (rev 0) +++ trunk/dports/devel/caml-ocamldbi/Portfile 2008-07-29 21:43:58 UTC (rev 38736) @@ -0,0 +1,35 @@ +# $Id: $ + +PortSystem 1.0 + +name caml-ocamldbi +version 0.9.11 +categories devel ocaml +maintainers landonf openmaintainer +description DBI library for simple database access. +long_description ${description} + +homepage http://merjis.com/developers/mod_caml +platforms darwin +master_sites http://download.savannah.gnu.org/releases/modcaml/ + +distname ocamldbi-${version} + +checksums md5 b22a0aeb956c9049359579cd2cba33fd \ + sha1 a48581b5348c6bc6e0607168ade2aa30b6b96163 \ + rmd160 270020a83b10ee672ca735228476d66cba1f2b3e + + +depends_lib port:ocaml \ + port:caml-findlib \ + port:caml-pcre \ + port:caml-postgresql \ + port:caml-sqlite3 + +patchfiles patch-postgresql.ml + +post-patch { + reinplace "s|/usr/share/doc|${prefix}/share/doc|g" ${worksrcpath}/Makefile.config +} + +use_configure no Added: trunk/dports/devel/caml-ocamldbi/files/patch-postgresql.ml =================================================================== --- trunk/dports/devel/caml-ocamldbi/files/patch-postgresql.ml (rev 0) +++ trunk/dports/devel/caml-ocamldbi/files/patch-postgresql.ml 2008-07-29 21:43:58 UTC (rev 38736) @@ -0,0 +1,32 @@ +--- dbi_postgresql.ml.orig 2008-07-29 14:18:16.000000000 -0700 ++++ dbi_postgresql.ml 2008-07-29 14:32:00.000000000 -0700 +@@ -120,9 +120,9 @@ + (fun h m s -> { Dbi.hour = h; Dbi.min = m; Dbi.sec = s; + Dbi.microsec = 0; Dbi.timezone = None }) + +-(* [encode_sql_t v] returns a string suitable for substitution of "?" ++(* [encode_sql_t conn v] returns a string suitable for substitution of "?" + in a SQL query. *) +-let encode_sql_t = function ++let encode_sql_t (conn : Pg.connection) = function + | `Null -> "NULL" + | `Int i -> + (* As we use [`Int] for INTEGER and SMALLINT, we quote the +@@ -139,7 +139,7 @@ + | `Timestamp t -> string_of_timestamp t + | `Interval i -> string_of_interval i + | `Blob s -> Dbi.string_escaped s (* FIXME *) +- | `Binary s -> "'" ^ Pg.escape_bytea s ^ "'::bytea" ++ | `Binary s -> "'" ^ (conn#escape_bytea s) ^ "'::bytea" + | `Unknown s -> s + + +@@ -209,7 +209,7 @@ + + let query = (* substitute args *) + Dbi.make_query "Dbi_postgres: execute called with wrong number of args." +- encode_sql_t query args in ++ (fun v -> encode_sql_t conn v) query args in + (* Send the query to the database. *) + let res = conn#exec query in +
participants (1)
-
landonf@macports.org