diff -Nru sexplib310-7.0.4/.hg_archival.txt sexplib310-7.0.5/.hg_archival.txt --- sexplib310-7.0.4/.hg_archival.txt 2011-09-15 23:06:48.000000000 +0000 +++ sexplib310-7.0.5/.hg_archival.txt 2012-03-20 16:41:54.000000000 +0000 @@ -1,4 +1,4 @@ repo: 3f3ede295629c1705d0d9cacc5eb2987690a5e09 -node: 4dedb3bc6b76a611fea5eaae9b1206e6d189b0ed +node: 66fbcdf675878b902292050afc697ac5ed26bee0 branch: default -tag: forge-release-7.0.4 +tag: forge-release-7.0.5 diff -Nru sexplib310-7.0.4/.hgtags sexplib310-7.0.5/.hgtags --- sexplib310-7.0.4/.hgtags 2011-09-15 23:06:48.000000000 +0000 +++ sexplib310-7.0.5/.hgtags 2012-03-20 16:41:54.000000000 +0000 @@ -44,3 +44,4 @@ 930b3d49ba7f842eb5e72571bceee9fe85d7e818 forge-release-7.0.1 08c4828114f8a858b691ff7580de2b7a80b6116e forge-release-7.0.2 447c281ac7ade27a8cf018f55f2e2798a4242deb forge-release-7.0.3 +4dedb3bc6b76a611fea5eaae9b1206e6d189b0ed forge-release-7.0.4 diff -Nru sexplib310-7.0.4/Changelog sexplib310-7.0.5/Changelog --- sexplib310-7.0.4/Changelog 2011-09-15 23:06:48.000000000 +0000 +++ sexplib310-7.0.5/Changelog 2012-03-20 16:41:54.000000000 +0000 @@ -1,3 +1,8 @@ +2012-03-20: Updated to latest Oasis release and a package dependency to + type_conv. + +2011-09-18: Improved documentation. + 2011-09-15: Fixes to improve package dependency resolution. 2011-07-05: Fixed a parser position bug. Parser positions passed by the user diff -Nru sexplib310-7.0.4/INSTALL sexplib310-7.0.5/INSTALL --- sexplib310-7.0.4/INSTALL 2011-09-15 23:06:48.000000000 +0000 +++ sexplib310-7.0.5/INSTALL 2012-03-20 16:41:54.000000000 +0000 @@ -1,5 +1,5 @@ (* OASIS_START *) -(* DO NOT EDIT (digest: 623866a2a9173f0ea5035a3d95fa48d2) *) +(* DO NOT EDIT (digest: b4b9b34e94dfc4c6914f87aae494ed32) *) This is the INSTALL file for the sexplib distribution. This package uses OASIS to generate its build system. See section OASIS for @@ -9,9 +9,9 @@ ============ In order to compile this package, you will need: -* ocaml (>= 3.12) for all, test conv, test sexp +* ocaml (>= 3.12) for all, test conv, test sexp, doc sexplib * findlib -* type-conv (>= 3.0.4) for library pa_sexp_conv +* type_conv (>= 3.0.5) for library pa_sexp_conv Installing ========== diff -Nru sexplib310-7.0.4/README.txt sexplib310-7.0.5/README.txt --- sexplib310-7.0.4/README.txt 2011-09-15 23:06:48.000000000 +0000 +++ sexplib310-7.0.5/README.txt 2012-03-20 16:41:54.000000000 +0000 @@ -1,12 +1,12 @@ - + README: library "Sexplib" ************************* - Copyright (C) 2011 Jane Street Holding, LLC (1) + Copyright (C) 2012 Jane Street Holding, LLC (1) ===================================================== Author: Markus Mottl ====================== - New York, 2010-03-31 + New York, 2012-03-20 ==================== @@ -63,7 +63,7 @@ *=*=*=*=*=*=*=*=*=*=*= - Make sure you have installed the 'type-conv' package on your system, too. It + Make sure you have installed the 'type_conv' package on your system, too. It should be obtainable at the same site as 'sexplib'. The API (.mli-files) in the 'sexplib' library directory is fully documented. @@ -88,6 +88,13 @@ signatures. Just add 'with sexp' to the type in a signature, and the appropriate function signatures will be generated. + Converters for standard types (int, list, Hashtbl.t, etc.) become visible to +the macro-generated code by opening the standard module before their first use +in a type definition. Users will therefore usually want to place the following +at the top of their files: +<< open Sexplib.Std +>> + See the file 'lib_test/conv_test.ml' for example usage. It also demonstrates how to extract and substitute sub-expressions. @@ -97,16 +104,16 @@ To compile a file you will have to add a preprocessing flag to the compiler invocation, e.g. for foo.ml: -<< ocamlc -pp "camlp4o -I {path to type-conv} \ +<< ocamlc -pp "camlp4o -I {path to type_conv} \ -I {path to sexplib} pa_type_conv.cmo pa_sexp_conv.cmo" \ -I {path to sexplib} foo.ml >> If you are using OCamlMakefile, just put the following line at the top of -the file, assuming you have installed both 'type-conv' and 'sexplib' with +the file, assuming you have installed both 'type_conv' and 'sexplib' with ocamlfind. The comment must start at the beginning of the line, and you must not break lines (here broken for readability only): -<< (*pp camlp4o -I `ocamlfind query type-conv` \ +<< (*pp camlp4o -I `ocamlfind query type_conv` \ -I `ocamlfind query sexplib` \ pa_type_conv.cmo pa_sexp_conv.cmo *) >> diff -Nru sexplib310-7.0.4/_oasis sexplib310-7.0.5/_oasis --- sexplib310-7.0.4/_oasis 2011-09-15 23:06:48.000000000 +0000 +++ sexplib310-7.0.5/_oasis 2012-03-20 16:41:54.000000000 +0000 @@ -1,24 +1,23 @@ -OASISFormat: 0.2 +OASISFormat: 0.3 OCamlVersion: >= 3.12 Name: sexplib -Version: 7.0.4 +Version: 7.0.5 Synopsis: automated S-expression conversion Authors: Markus Mottl, Martin Sandin Copyrights: (C) 2005-2011 Jane Street Capital LLC License: LGPL-2.1 with OCaml linking exception LicenseFile: LICENSE -Plugins: StdFiles (0.2), - DevFiles (0.2), - META (0.2) -BuildTools: ocamlbuild +Plugins: StdFiles (0.3), + DevFiles (0.3), + META (0.3) +BuildTools: ocamlbuild, camlp4o XStdFilesAUTHORS: false XStdFilesINSTALLFilename: INSTALL XStdFilesREADME: false Library sexplib Path: lib - FindlibName: sexplib Pack: true Modules: Type, Parser, @@ -39,10 +38,10 @@ FindlibName: syntax FindlibParent: sexplib Modules: Pa_sexp_conv - BuildDepends: camlp4.quotations,camlp4.extend,type-conv (>= 3.0.4) + BuildDepends: camlp4.quotations,camlp4.extend,type_conv (>= 3.0.5) CompiledObject: byte XMETAType: syntax - XMETARequires: type-conv,sexplib + XMETARequires: type_conv,sexplib XMETADescription: Syntax extension for Sexplib Library sexplib_top @@ -53,10 +52,6 @@ XMETARequires: sexplib XMETADescription: Toplevel printers for S-expressions -Flag tests - Description: Build and run tests - Default: true - Executable sexp_test Path: lib_test MainIs: sexp_test.ml @@ -80,3 +75,10 @@ Run$: flag(tests) Command: $conv_test WorkingDirectory: lib_test + +Document "sexplib" + Title: API reference for sexplib + Type: ocamlbuild (0.3) + BuildTools+: ocamldoc + XOCamlbuildPath: lib + XOCamlbuildLibraries: sexplib diff -Nru sexplib310-7.0.4/_tags sexplib310-7.0.5/_tags --- sexplib310-7.0.4/_tags 2011-09-15 23:06:48.000000000 +0000 +++ sexplib310-7.0.5/_tags 2012-03-20 16:41:54.000000000 +0000 @@ -1,48 +1,50 @@ # OASIS_START -# DO NOT EDIT (digest: fc4363b322c63fb8ba9b69b2ba924c08) +# DO NOT EDIT (digest: a1d81a7e4d410a35183ff1a62ca59486) +# Ignore VCS directories, you can use the same kind of rule outside +# OASIS_START/STOP if you want to exclude directories that contains +# useless stuff for the build process +<**/.svn>: -traverse +<**/.svn>: not_hygienic +".bzr": -traverse +".bzr": not_hygienic +".hg": -traverse +".hg": not_hygienic +".git": -traverse +".git": not_hygienic +"_darcs": -traverse +"_darcs": not_hygienic # Library sexplib "lib": include "lib/type.cmx": for-pack(Sexplib) -"lib/Type.cmx": for-pack(Sexplib) "lib/parser.cmx": for-pack(Sexplib) -"lib/Parser.cmx": for-pack(Sexplib) "lib/lexer.cmx": for-pack(Sexplib) -"lib/Lexer.cmx": for-pack(Sexplib) "lib/pre_sexp.cmx": for-pack(Sexplib) -"lib/Pre_sexp.cmx": for-pack(Sexplib) "lib/sexp_intf.cmx": for-pack(Sexplib) -"lib/Sexp_intf.cmx": for-pack(Sexplib) "lib/sexp.cmx": for-pack(Sexplib) -"lib/Sexp.cmx": for-pack(Sexplib) "lib/path.cmx": for-pack(Sexplib) -"lib/Path.cmx": for-pack(Sexplib) "lib/conv.cmx": for-pack(Sexplib) -"lib/Conv.cmx": for-pack(Sexplib) "lib/conv_error.cmx": for-pack(Sexplib) -"lib/Conv_error.cmx": for-pack(Sexplib) "lib/exn_magic.cmx": for-pack(Sexplib) -"lib/Exn_magic.cmx": for-pack(Sexplib) "lib/std.cmx": for-pack(Sexplib) -"lib/Std.cmx": for-pack(Sexplib) : pkg_unix : pkg_num : pkg_bigarray # Library pa_sexp_conv "syntax": include -: pkg_type-conv +: pkg_type_conv : pkg_camlp4.quotations : pkg_camlp4.extend # Executable conv_test "lib_test/conv_test.byte": use_pa_sexp_conv "lib_test/conv_test.byte": use_sexplib "lib_test/conv_test.byte": pkg_unix -"lib_test/conv_test.byte": pkg_type-conv +"lib_test/conv_test.byte": pkg_type_conv "lib_test/conv_test.byte": pkg_num "lib_test/conv_test.byte": pkg_camlp4.quotations "lib_test/conv_test.byte": pkg_camlp4.extend "lib_test/conv_test.byte": pkg_bigarray : use_pa_sexp_conv -: pkg_type-conv +: pkg_type_conv : pkg_camlp4.quotations : pkg_camlp4.extend # Library sexplib_top @@ -60,7 +62,7 @@ : syntax_camlp4o :pp(cpp -traditional -undef) -"lib_test/conv_test.ml": syntax_camlp4o, pkg_type-conv.syntax +"lib_test/conv_test.ml": syntax_camlp4o, pkg_type_conv.syntax # Remove this line, once BuildDepends: sexplib... will be taken # into account "lib_test/conv_test.byte": use_sexplib, pkg_unix, pkg_num, pkg_bigarray diff -Nru sexplib310-7.0.4/configure sexplib310-7.0.5/configure --- sexplib310-7.0.4/configure 2011-09-15 23:06:48.000000000 +0000 +++ sexplib310-7.0.5/configure 2012-03-20 16:41:54.000000000 +0000 @@ -1,8 +1,27 @@ #!/bin/sh # OASIS_START -# DO NOT EDIT (digest: ed33e59fe00e48bc31edf413bbc8b8d6) +# DO NOT EDIT (digest: 425187ed8bfdbdd207fd76392dd243a7) set -e -ocaml setup.ml -configure $* +FST=true +for i in "$@"; do + if $FST; then + set -- + FST=false + fi + + case $i in + --*=*) + ARG=${i%%=*} + VAL=${i##*=} + set -- "$@" "$ARG" "$VAL" + ;; + *) + set -- "$@" "$i" + ;; + esac +done + +ocaml setup.ml -configure "$@" # OASIS_STOP diff -Nru sexplib310-7.0.4/debian/changelog sexplib310-7.0.5/debian/changelog --- sexplib310-7.0.4/debian/changelog 2012-01-18 12:04:29.000000000 +0000 +++ sexplib310-7.0.5/debian/changelog 2013-06-22 15:43:43.000000000 +0000 @@ -1,3 +1,21 @@ +sexplib310 (7.0.5-1) unstable; urgency=low + + [ Stéphane Glondu ] + * Team upload + * New upstream release (Closes: #713343) + - bump type-conv version requirement + * Update debian/watch + * Update debian/control: Vcs-*, Homepage + * Bump debhelper compat level to 9 + * Switch debian/copyright to format version 1.0 + * Bump Standards-Version to 3.9.4 + * Add doc-base support + + [ Sylvain Le Gall ] + * Remove Sylvain Le Gall from uploaders + + -- Stéphane Glondu Sat, 22 Jun 2013 17:39:48 +0200 + sexplib310 (7.0.4-2) unstable; urgency=low * Team upload. diff -Nru sexplib310-7.0.4/debian/compat sexplib310-7.0.5/debian/compat --- sexplib310-7.0.4/debian/compat 2012-01-18 12:01:20.000000000 +0000 +++ sexplib310-7.0.5/debian/compat 2013-06-22 15:43:43.000000000 +0000 @@ -1 +1 @@ -8 +9 diff -Nru sexplib310-7.0.4/debian/control sexplib310-7.0.5/debian/control --- sexplib310-7.0.4/debian/control 2012-01-18 12:01:20.000000000 +0000 +++ sexplib310-7.0.5/debian/control 2013-06-22 15:43:43.000000000 +0000 @@ -2,20 +2,18 @@ Section: ocaml Priority: extra Maintainer: Debian OCaml Maintainers -Uploaders: - Sylvain Le Gall Build-Depends: - debhelper (>= 8), + debhelper (>= 9), ocaml-nox (>= 3.12.0), ocaml-findlib (>= 1.2.4-2), camlp4, camlp4-extra, - libtype-conv-camlp4-dev (>= 3.0.4), + libtype-conv-camlp4-dev (>= 3.0.5), dh-ocaml (>= 0.9~) -Standards-Version: 3.9.2 -Vcs-Browser: http://git.debian.org/?p=pkg-ocaml-maint/packages/sexplib310.git -Vcs-Git: git://git.debian.org/git/pkg-ocaml-maint/packages/sexplib310.git -Homepage: http://forge.ocamlcore.org/projects/sexplib/ +Standards-Version: 3.9.4 +Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-ocaml-maint/packages/sexplib310.git +Vcs-Git: git://anonscm.debian.org/pkg-ocaml-maint/packages/sexplib310.git +Homepage: http://janestreet.github.io/ Package: libsexplib-camlp4-dev Provides: diff -Nru sexplib310-7.0.4/debian/copyright sexplib310-7.0.5/debian/copyright --- sexplib310-7.0.4/debian/copyright 2012-01-18 12:01:20.000000000 +0000 +++ sexplib310-7.0.5/debian/copyright 2013-06-22 15:43:43.000000000 +0000 @@ -1,55 +1,43 @@ -Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat -Upstream-Author: Markus Mottl +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Packaged-By: Stefano Zacchiroli Packaged-Date: Sat, 03 May 2008 11:54:13 +0200. -Original-Source-Location: http://janestcapital.com/ocaml/ Files: * -Copyright: © 2005-2008 Markus Mottl - © 2005-2008 Jane Street Holding, LLC -License: LGPL-2.1 | other - As a special exception to the GNU Lesser General Public License, you - may link, statically or dynamically, a "work that uses the Library" - with a publicly distributed version of the Library to produce an - executable file containing portions of the Library, and distribute that - executable file under terms of your choice, without any of the additional - requirements listed in clause 6 of the GNU Lesser General Public License. - By "a publicly distributed version of the Library", we mean either the - unmodified Library as distributed by the authors, or a modified version - of the Library that is distributed under the conditions defined in clause - 3 of the GNU Lesser General Public License. This exception does not - however invalidate any other reasons why the executable file might be - covered by the GNU Lesser General Public License. - -The Library is distributed under the terms of the GNU Lesser General Public -License version 2.1, with the special exception to it reported above. - -The full text of the GNU Lessere General Public License version 2.1 can be -found in `/usr/share/common-licenses/LGPL-2.1'. +Copyright: 2005-2008, Markus Mottl + 2005-2008, Jane Street Holding, LLC +License: LGPL-2.1-ocaml -Files: lib/pa_sexp_conv.ml, lib/pa_sexp_conv.mli +Files: lib/pa_sexp_conv.ml lib/pa_sexp_conv.mli Copyright: © 2005-2008 Markus Mottl © 2005-2008 Jane Street Holding, LLC © 2004-2005 Martin Sandin -License: LGPL-2.1 | other - As a special exception to the GNU Lesser General Public License, you - may link, statically or dynamically, a "work that uses the Library" - with a publicly distributed version of the Library to produce an - executable file containing portions of the Library, and distribute that - executable file under terms of your choice, without any of the additional - requirements listed in clause 6 of the GNU Lesser General Public License. - By "a publicly distributed version of the Library", we mean either the - unmodified Library as distributed by the authors, or a modified version - of the Library that is distributed under the conditions defined in clause - 3 of the GNU Lesser General Public License. This exception does not - however invalidate any other reasons why the executable file might be - covered by the GNU Lesser General Public License. +License: LGPL-2.1-ocaml Files: debian/* -Copyright: © 2008 Stefano Zacchiroli +Copyright: 2008, Stefano Zacchiroli License: GPL-3+ + The Debian packaging is copyright Stefano Zacchiroli, and licensed + under the GNU General Public License, see + `/usr/share/common-licenses/GPL-3' for the full text. -The Debian packaging is copyright Stefano Zacchiroli, and licensed -under the GNU General Public License, see -`/usr/share/common-licenses/GPL-3' for the full text. - +License: LGPL-2.1-ocaml + As a special exception to the GNU Lesser General Public License, you + may link, statically or dynamically, a "work that uses the Library" + with a publicly distributed version of the Library to produce an + executable file containing portions of the Library, and distribute + that executable file under terms of your choice, without any of the + additional requirements listed in clause 6 of the GNU Lesser General + Public License. By "a publicly distributed version of the Library", + we mean either the unmodified Library as distributed by the authors, + or a modified version of the Library that is distributed under the + conditions defined in clause 3 of the GNU Lesser General Public + License. This exception does not however invalidate any other + reasons why the executable file might be covered by the GNU Lesser + General Public License. + . + The Library is distributed under the terms of the GNU Lesser General + Public License version 2.1, with the special exception to it reported + above. + . + The full text of the GNU Lessere General Public License version 2.1 + can be found in `/usr/share/common-licenses/LGPL-2.1'. diff -Nru sexplib310-7.0.4/debian/libsexplib-camlp4-dev.ocamldoc sexplib310-7.0.5/debian/libsexplib-camlp4-dev.ocamldoc --- sexplib310-7.0.4/debian/libsexplib-camlp4-dev.ocamldoc 1970-01-01 00:00:00.000000000 +0000 +++ sexplib310-7.0.5/debian/libsexplib-camlp4-dev.ocamldoc 2013-06-22 15:43:43.000000000 +0000 @@ -0,0 +1 @@ +--doc-base-generate diff -Nru sexplib310-7.0.4/debian/patches/0001-Improved-documentation.patch sexplib310-7.0.5/debian/patches/0001-Improved-documentation.patch --- sexplib310-7.0.4/debian/patches/0001-Improved-documentation.patch 2012-01-18 12:01:20.000000000 +0000 +++ sexplib310-7.0.5/debian/patches/0001-Improved-documentation.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -From: Mehdi Dogguy -Date: Wed, 18 Jan 2012 13:00:38 +0100 -Subject: Improved documentation. - -Patch imported from upstream's HG repository (changeset 145:8009984e1561). ---- - Changelog | 2 ++ - README.txt | 7 +++++++ - doc/README.tex | 9 +++++++++ - 3 files changed, 18 insertions(+), 0 deletions(-) - -diff --git a/Changelog b/Changelog -index 9599cc8..9cec567 100644 ---- a/Changelog -+++ b/Changelog -@@ -1,3 +1,5 @@ -+2011-09-18: Improved documentation. -+ - 2011-09-15: Fixes to improve package dependency resolution. - - 2011-07-05: Fixed a parser position bug. Parser positions passed by the user -diff --git a/README.txt b/README.txt -index 553a65e..4a90098 100644 ---- a/README.txt -+++ b/README.txt -@@ -88,6 +88,13 @@ preprocessor also supports automatic addition of conversion functions to - signatures. Just add 'with sexp' to the type in a signature, and the - appropriate function signatures will be generated. - -+ Converters for standard types (int, list, Hashtbl.t, etc.) become visible to -+the macro-generated code by opening the standard module before their first use -+in a type definition. Users will therefore usually want to place the following -+at the top of their files: -+<< open Sexplib.Std -+>> -+ - See the file 'lib_test/conv_test.ml' for example usage. It also demonstrates - how to extract and substitute sub-expressions. - -diff --git a/doc/README.tex b/doc/README.tex -index bed1e2c..23b8b43 100644 ---- a/doc/README.tex -+++ b/doc/README.tex -@@ -100,6 +100,15 @@ of conversion functions to signatures. Just add \verb=with sexp= to - the type in a signature, and the appropriate function signatures will - be generated.\\ - \\ -+Converters for standard types (int, list, Hashtbl.t, etc.) become visible to -+the macro-generated code by opening the standard module before their first -+use in a type definition. Users will therefore usually want to place the -+following at the top of their files: -+ -+\begin{verbatim} -+ open Sexplib.Std -+\end{verbatim} -+ - See the file \verb=lib_test/conv_test.ml= for example usage. It also - demonstrates how to extract and substitute sub-expressions. - --- diff -Nru sexplib310-7.0.4/debian/patches/series sexplib310-7.0.5/debian/patches/series --- sexplib310-7.0.4/debian/patches/series 2012-01-18 12:01:20.000000000 +0000 +++ sexplib310-7.0.5/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -0001-Improved-documentation.patch diff -Nru sexplib310-7.0.4/debian/rules sexplib310-7.0.5/debian/rules --- sexplib310-7.0.4/debian/rules 2012-01-18 12:01:20.000000000 +0000 +++ sexplib310-7.0.5/debian/rules 2013-06-22 15:31:37.000000000 +0000 @@ -11,7 +11,7 @@ .PHONY: override_dh_auto_configure override_dh_auto_configure: - ocaml setup.ml -configure --prefix /usr --destdir '$(DESTDIR)' + ocaml setup.ml -configure --prefix /usr --destdir '$(DESTDIR)' --docdir /usr/share/doc/libsexplib-camlp4-dev/html/api .PHONY: override_dh_auto_build override_dh_auto_build: diff -Nru sexplib310-7.0.4/debian/watch sexplib310-7.0.5/debian/watch --- sexplib310-7.0.4/debian/watch 2012-01-18 12:01:20.000000000 +0000 +++ sexplib310-7.0.5/debian/watch 2013-06-22 15:26:50.000000000 +0000 @@ -1,3 +1,2 @@ version=3 -opts=filenamemangle=s/.*-(.*)\.tar\.gz/sexplib310-$1.tar.gz/ \ -http://forge.ocamlcore.org/frs/?group_id=259 .*/sexplib-(.*)\.tar\.gz +http://githubredir.debian.net/github/janestreet/bin_prot /(\d+\.\d+\.\d+)\.tar\.gz diff -Nru sexplib310-7.0.4/doc/README.tex sexplib310-7.0.5/doc/README.tex --- sexplib310-7.0.4/doc/README.tex 2011-09-15 23:06:48.000000000 +0000 +++ sexplib310-7.0.5/doc/README.tex 2012-03-20 16:41:54.000000000 +0000 @@ -32,7 +32,7 @@ Copyright \quad (C) \quad \theyear \quad \janeshort \quad\\ Author: Markus Mottl } -\date{New York, 2010-03-31} +\date{New York, 2012-03-20} % DOCUMENT \begin{document} @@ -71,7 +71,7 @@ \section{How can you use it?} -Make sure you have installed the \verb=type-conv= package on your system, +Make sure you have installed the \verb=type_conv= package on your system, too. It should be obtainable at the same site as \verb=sexplib=.\\ \\ The API (.mli-files) in the \verb=sexplib= library directory is @@ -100,6 +100,15 @@ the type in a signature, and the appropriate function signatures will be generated.\\ \\ +Converters for standard types (int, list, Hashtbl.t, etc.) become visible to +the macro-generated code by opening the standard module before their first +use in a type definition. Users will therefore usually want to place the +following at the top of their files: + +\begin{verbatim} + open Sexplib.Std +\end{verbatim} + See the file \verb=lib_test/conv_test.ml= for example usage. It also demonstrates how to extract and substitute sub-expressions. @@ -109,18 +118,18 @@ compiler invocation, e.g. for foo.ml: \begin{verbatim} - ocamlc -pp "camlp4o -I {path to type-conv} \ + ocamlc -pp "camlp4o -I {path to type_conv} \ -I {path to sexplib} pa_type_conv.cmo pa_sexp_conv.cmo" \ -I {path to sexplib} foo.ml \end{verbatim} If you are using OCamlMakefile, just put the following line at the -top of the file, assuming you have installed both \verb=type-conv= and +top of the file, assuming you have installed both \verb=type_conv= and \verb=sexplib= with ocamlfind. The comment must start at the beginning of the line, and you must not break lines (here broken for readability only): \begin{verbatim} - (*pp camlp4o -I `ocamlfind query type-conv` \ + (*pp camlp4o -I `ocamlfind query type_conv` \ -I `ocamlfind query sexplib` \ pa_type_conv.cmo pa_sexp_conv.cmo *) \end{verbatim} diff -Nru sexplib310-7.0.4/lib/META sexplib310-7.0.5/lib/META --- sexplib310-7.0.4/lib/META 2011-09-15 23:06:48.000000000 +0000 +++ sexplib310-7.0.5/lib/META 2012-03-20 16:41:54.000000000 +0000 @@ -1,26 +1,26 @@ # OASIS_START -# DO NOT EDIT (digest: c6a0876123fd610ef2e8594e61105626) -version = "7.0.4" +# DO NOT EDIT (digest: 753f7af494baaf733d5ff4e8d89ff68b) +version = "7.0.5" description = "automated S-expression conversion" requires = "unix bigarray num" archive(byte) = "sexplib.cma" archive(native) = "sexplib.cmxa" exists_if = "sexplib.cma" -package "syntax" ( - version = "7.0.4" - description = "Syntax extension for Sexplib" - requires = "type-conv sexplib" - archive(syntax,preprocessor) = "pa_sexp_conv.cma" - archive(syntax,toploop) = "pa_sexp_conv.cma" - exists_if = "pa_sexp_conv.cma" -) - package "top" ( - version = "7.0.4" + version = "7.0.5" description = "Toplevel printers for S-expressions" requires = "sexplib" archive(byte) = "sexplib_top.cma" archive(native) = "sexplib_top.cmxa" exists_if = "sexplib_top.cma" ) + +package "syntax" ( + version = "7.0.5" + description = "Syntax extension for Sexplib" + requires = "type_conv sexplib" + archive(syntax, preprocessor) = "pa_sexp_conv.cma" + archive(syntax, toploop) = "pa_sexp_conv.cma" + exists_if = "pa_sexp_conv.cma" +) # OASIS_STOP diff -Nru sexplib310-7.0.4/lib/sexplib.odocl sexplib310-7.0.5/lib/sexplib.odocl --- sexplib310-7.0.4/lib/sexplib.odocl 1970-01-01 00:00:00.000000000 +0000 +++ sexplib310-7.0.5/lib/sexplib.odocl 2012-03-20 16:41:54.000000000 +0000 @@ -0,0 +1,14 @@ +# OASIS_START +# DO NOT EDIT (digest: b651711e3df0db633d7b7a99717aabde) +Type +Parser +Lexer +Pre_sexp +Sexp_intf +Sexp +Path +Conv +Conv_error +Exn_magic +Std +# OASIS_STOP diff -Nru sexplib310-7.0.4/myocamlbuild.ml sexplib310-7.0.5/myocamlbuild.ml --- sexplib310-7.0.4/myocamlbuild.ml 2011-09-15 23:06:48.000000000 +0000 +++ sexplib310-7.0.5/myocamlbuild.ml 2012-03-20 16:41:54.000000000 +0000 @@ -1,12 +1,12 @@ (* OASIS_START *) -(* DO NOT EDIT (digest: 9e7fb46a73256f0505e4cfb4f515afc4) *) +(* DO NOT EDIT (digest: 6a36af2626fc8bc901ff0b729583bf22) *) module OASISGettext = struct -# 21 "/Users/mmottl/Downloads/oasis/src/oasis/OASISGettext.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISGettext.ml" - let ns_ str = + let ns_ str = str - let s_ str = + let s_ str = str let f_ (str : ('a, 'b, 'c, 'd) format4) = @@ -18,13 +18,13 @@ else fmt2^^"" - let init = + let init = [] end module OASISExpr = struct -# 21 "/Users/mmottl/Downloads/oasis/src/oasis/OASISExpr.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISExpr.ml" @@ -46,18 +46,18 @@ type 'a choices = (t * 'a) list let eval var_get t = - let rec eval' = + let rec eval' = function | EBool b -> b - | ENot e -> + | ENot e -> not (eval' e) | EAnd (e1, e2) -> (eval' e1) && (eval' e2) - | EOr (e1, e2) -> + | EOr (e1, e2) -> (eval' e1) || (eval' e2) | EFlag nm -> @@ -76,19 +76,19 @@ eval' t let choose ?printer ?name var_get lst = - let rec choose_aux = + let rec choose_aux = function | (cond, vl) :: tl -> - if eval var_get cond then - vl + if eval var_get cond then + vl else choose_aux tl | [] -> - let str_lst = + let str_lst = if lst = [] then s_ "" else - String.concat + String.concat (s_ ", ") (List.map (fun (cond, vl) -> @@ -97,10 +97,10 @@ | None -> s_ "") lst) in - match name with + match name with | Some nm -> failwith - (Printf.sprintf + (Printf.sprintf (f_ "No result for the choice list '%s': %s") nm str_lst) | None -> @@ -115,14 +115,14 @@ module BaseEnvLight = struct -# 21 "/Users/mmottl/Downloads/oasis/src/base/BaseEnvLight.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseEnvLight.ml" module MapString = Map.Make(String) type t = string MapString.t let default_filename = - Filename.concat + Filename.concat (Sys.getcwd ()) "setup.data" @@ -138,23 +138,23 @@ let line = ref 1 in - let st_line = + let st_line = Stream.from (fun _ -> try - match Stream.next st with + match Stream.next st with | '\n' -> incr line; Some '\n' | c -> Some c with Stream.Failure -> None) in - let lexer = + let lexer = Genlex.make_lexer ["="] st_line in let rec read_file mp = - match Stream.npeek 3 lexer with + match Stream.npeek 3 lexer with | [Genlex.Ident nm; Genlex.Kwd "="; Genlex.String value] -> - Stream.junk lexer; - Stream.junk lexer; + Stream.junk lexer; + Stream.junk lexer; Stream.junk lexer; read_file (MapString.add nm value mp) | [] -> @@ -177,8 +177,8 @@ end else begin - failwith - (Printf.sprintf + failwith + (Printf.sprintf "Unable to load environment, the file '%s' doesn't exist." filename) end @@ -188,23 +188,23 @@ let buff = Buffer.create ((String.length str) * 2) in - Buffer.add_substitute + Buffer.add_substitute buff - (fun var -> - try + (fun var -> + try var_expand (MapString.find var env) with Not_found -> - failwith - (Printf.sprintf + failwith + (Printf.sprintf "No variable %s defined when trying to expand %S." - var + var str)) str; Buffer.contents buff in var_expand (MapString.find name env) - let var_choose lst env = + let var_choose lst env = OASISExpr.choose (fun nm -> var_get nm env) lst @@ -212,7 +212,7 @@ module MyOCamlbuildFindlib = struct -# 21 "/Users/mmottl/Downloads/oasis/src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" (** OCamlbuild extension, copied from * http://brion.inria.fr/gallium/index.php/Using_ocamlfind_with_ocamlbuild @@ -310,8 +310,8 @@ * To solve this, one approach is to add the "-thread" option when using * the "threads" package using the previous plugin. *) - flag ["ocaml"; "pkg_threads"; "doc"] (S[A "-thread"]); flag ["ocaml"; "pkg_threads"; "compile"] (S[A "-thread"]); + flag ["ocaml"; "pkg_threads"; "doc"] (S[A "-I"; A "+threads"]); flag ["ocaml"; "pkg_threads"; "link"] (S[A "-thread"]); flag ["ocaml"; "pkg_threads"; "infer_interface"] (S[A "-thread"]) @@ -321,7 +321,7 @@ end module MyOCamlbuildBase = struct -# 21 "/Users/mmottl/Downloads/oasis/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" (** Base functions for writing myocamlbuild.ml @author Sylvain Le Gall @@ -336,7 +336,7 @@ type name = string type tag = string -# 55 "/Users/mmottl/Downloads/oasis/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" +# 55 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" type t = { @@ -414,7 +414,10 @@ (* When ocaml link something that use the C library, then one need that file to be up to date. *) - dep ["compile"; "ocaml"; "use_lib"^lib] + dep ["link"; "ocaml"; "program"; "use_lib"^lib] + [dir/"lib"^lib^"."^(!Options.ext_lib)]; + + dep ["compile"; "ocaml"; "program"; "use_lib"^lib] [dir/"lib"^lib^"."^(!Options.ext_lib)]; (* TODO: be more specific about what depends on headers *) @@ -465,6 +468,7 @@ let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;; +# 472 "myocamlbuild.ml" (* OASIS_STOP *) Ocamlbuild_plugin.dispatch diff -Nru sexplib310-7.0.4/setup.ml sexplib310-7.0.5/setup.ml --- sexplib310-7.0.4/setup.ml 2011-09-15 23:06:48.000000000 +0000 +++ sexplib310-7.0.5/setup.ml 2012-03-20 16:41:54.000000000 +0000 @@ -1,19 +1,19 @@ (* setup.ml generated for the first time by OASIS v0.2.0 *) (* OASIS_START *) -(* DO NOT EDIT (digest: 59717824efeaebec4080d50806fae221) *) +(* DO NOT EDIT (digest: 45e10b84ce2d3eaf3fd842c91210e92a) *) (* - Regenerated by OASIS v0.2.0 + Regenerated by OASIS v0.3.0~rc2 Visit http://oasis.forge.ocamlcore.org for more information and documentation about functions used in this file. *) module OASISGettext = struct -# 21 "/Users/mmottl/Downloads/oasis/src/oasis/OASISGettext.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISGettext.ml" - let ns_ str = + let ns_ str = str - let s_ str = + let s_ str = str let f_ (str : ('a, 'b, 'c, 'd) format4) = @@ -25,55 +25,53 @@ else fmt2^^"" - let init = + let init = [] end module OASISContext = struct -# 21 "/Users/mmottl/Downloads/oasis/src/oasis/OASISContext.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISContext.ml" - open OASISGettext + open OASISGettext type level = [ `Debug - | `Info + | `Info | `Warning | `Error] type t = { - verbose: bool; - debug: bool; - ignore_plugins: bool; - printf: level -> string -> unit; + verbose: bool; + debug: bool; + ignore_plugins: bool; + ignore_unknown_fields: bool; + printf: level -> string -> unit; } - let printf lvl str = - let beg = - match lvl with + let printf lvl str = + let beg = + match lvl with | `Error -> s_ "E: " | `Warning -> s_ "W: " | `Info -> s_ "I: " | `Debug -> s_ "D: " in - match lvl with - | `Error -> - prerr_endline (beg^str) - | _ -> - print_endline (beg^str) + prerr_endline (beg^str) let default = - ref + ref { - verbose = true; - debug = false; - ignore_plugins = false; - printf = printf; + verbose = true; + debug = false; + ignore_plugins = false; + ignore_unknown_fields = false; + printf = printf; } - let quiet = - {!default with + let quiet = + {!default with verbose = false; debug = false; } @@ -90,7 +88,9 @@ end module OASISUtils = struct -# 21 "/Users/mmottl/Downloads/oasis/src/oasis/OASISUtils.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISUtils.ml" + + open OASISGettext module MapString = Map.Make(String) @@ -103,7 +103,7 @@ module SetString = Set.Make(String) let set_string_add_list st lst = - List.fold_left + List.fold_left (fun acc e -> SetString.add e acc) st lst @@ -113,15 +113,15 @@ SetString.empty - let compare_csl s1 s2 = + let compare_csl s1 s2 = String.compare (String.lowercase s1) (String.lowercase s2) - module HashStringCsl = + module HashStringCsl = Hashtbl.Make (struct type t = string - let equal s1 s2 = + let equal s1 s2 = (String.lowercase s1) = (String.lowercase s2) let hash s = @@ -135,16 +135,16 @@ let rec split_aux acc pos = if pos < str_len then ( - let pos_sep = + let pos_sep = try String.index_from str pos sep with Not_found -> str_len in - let part = - String.sub str pos (pos_sep - pos) + let part = + String.sub str pos (pos_sep - pos) in - let acc = + let acc = part :: acc in if pos_sep >= str_len then @@ -170,14 +170,14 @@ split_aux [] 0 - let varname_of_string ?(hyphen='_') s = + let varname_of_string ?(hyphen='_') s = if String.length s = 0 then begin - invalid_arg "varname_of_string" + invalid_arg "varname_of_string" end else begin - let buff = + let buff = Buffer.create (String.length s) in (* Start with a _ if digit *) @@ -186,10 +186,10 @@ String.iter (fun c -> - if ('a' <= c && c <= 'z') - || - ('A' <= c && c <= 'Z') - || + if ('a' <= c && c <= 'z') + || + ('A' <= c && c <= 'Z') + || ('0' <= c && c <= '9') then Buffer.add_char buff c else @@ -199,8 +199,8 @@ String.lowercase (Buffer.contents buff) end - let varname_concat ?(hyphen='_') p s = - let p = + let varname_concat ?(hyphen='_') p s = + let p = let p_len = String.length p in @@ -209,7 +209,7 @@ else p in - let s = + let s = let s_len = String.length s in @@ -221,54 +221,46 @@ Printf.sprintf "%s%c%s" p hyphen s - let is_varname str = + let is_varname str = str = varname_of_string str - let failwithf1 fmt a = - failwith (Printf.sprintf fmt a) - - let failwithf2 fmt a b = - failwith (Printf.sprintf fmt a b) - - let failwithf3 fmt a b c = - failwith (Printf.sprintf fmt a b c) - - let failwithf4 fmt a b c d = - failwith (Printf.sprintf fmt a b c d) - - let failwithf5 fmt a b c d e = - failwith (Printf.sprintf fmt a b c d e) + let failwithf fmt = Printf.ksprintf failwith fmt end module PropList = struct -# 21 "/Users/mmottl/Downloads/oasis/src/oasis/PropList.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/PropList.ml" open OASISGettext type name = string - exception Not_set of name * string option + exception Not_set of name * string option exception No_printer of name exception Unknown_field of name * name - let string_of_exception = - function - | Not_set (nm, Some rsn) -> - Printf.sprintf (f_ "Field '%s' is not set: %s") nm rsn - | Not_set (nm, None) -> - Printf.sprintf (f_ "Field '%s' is not set") nm - | No_printer nm -> - Printf.sprintf (f_ "No default printer for value %s") nm - | Unknown_field (nm, schm) -> - Printf.sprintf (f_ "Field %s is not defined in schema %s") nm schm - | e -> - raise e + let () = + Printexc.register_printer + (function + | Not_set (nm, Some rsn) -> + Some + (Printf.sprintf (f_ "Field '%s' is not set: %s") nm rsn) + | Not_set (nm, None) -> + Some + (Printf.sprintf (f_ "Field '%s' is not set") nm) + | No_printer nm -> + Some + (Printf.sprintf (f_ "No default printer for value %s") nm) + | Unknown_field (nm, schm) -> + Some + (Printf.sprintf (f_ "Field %s is not defined in schema %s") nm schm) + | _ -> + None) module Data = struct - type t = + type t = (name, unit -> unit) Hashtbl.t let create () = @@ -277,10 +269,10 @@ let clear t = Hashtbl.clear t -# 66 "/Users/mmottl/Downloads/oasis/src/oasis/PropList.ml" +# 71 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/PropList.ml" end - module Schema = + module Schema = struct type ('ctxt, 'extra) value = @@ -299,43 +291,43 @@ name_norm: string -> string; } - let create ?(case_insensitive=false) nm = + let create ?(case_insensitive=false) nm = { name = nm; fields = Hashtbl.create 13; order = Queue.create (); - name_norm = - (if case_insensitive then + name_norm = + (if case_insensitive then String.lowercase else fun s -> s); } - let add t nm set get extra help = - let key = + let add t nm set get extra help = + let key = t.name_norm nm in if Hashtbl.mem t.fields key then failwith - (Printf.sprintf + (Printf.sprintf (f_ "Field '%s' is already defined in schema '%s'") nm t.name); - Hashtbl.add - t.fields - key + Hashtbl.add + t.fields + key { - set = set; - get = get; + set = set; + get = get; help = help; extra = extra; }; - Queue.add nm t.order + Queue.add nm t.order let mem t nm = - Hashtbl.mem t.fields nm + Hashtbl.mem t.fields nm - let find t nm = + let find t nm = try Hashtbl.find t.fields (t.name_norm nm) with Not_found -> @@ -345,28 +337,28 @@ (find t nm).get data let set t data nm ?context x = - (find t nm).set - data - ?context + (find t nm).set + data + ?context x let fold f acc t = - Queue.fold + Queue.fold (fun acc k -> let v = find t k in f acc k v.extra v.help) - acc + acc t.order let iter f t = - fold + fold (fun () -> f) () t - let name t = + let name t = t.name end @@ -383,7 +375,7 @@ extra: 'extra; } - let new_id = + let new_id = let last_id = ref 0 in @@ -391,20 +383,20 @@ let create ?schema ?name ?parse ?print ?default ?update ?help extra = (* Default value container *) - let v = - ref None + let v = + ref None in (* If name is not given, create unique one *) - let nm = - match name with + let nm = + match name with | Some s -> s | None -> Printf.sprintf "_anon_%d" (new_id ()) in (* Last chance to get a value: the default *) - let default () = - match default with + let default () = + match default with | Some d -> d | None -> raise (Not_set (nm, Some (s_ "no default value"))) in @@ -412,22 +404,22 @@ (* Get data *) let get data = (* Get value *) - try + try (Hashtbl.find data nm) (); - match !v with - | Some x -> x + match !v with + | Some x -> x | None -> default () with Not_found -> default () in (* Set data *) - let set data ?context x = - let x = - match update with + let set data ?context x = + let x = + match update with | Some f -> begin - try + try f ?context (get data) x with Not_set _ -> x @@ -435,21 +427,21 @@ | None -> x in - Hashtbl.replace - data - nm - (fun () -> v := Some x) + Hashtbl.replace + data + nm + (fun () -> v := Some x) in (* Parse string value, if possible *) let parse = - match parse with - | Some f -> + match parse with + | Some f -> f | None -> fun ?context s -> - failwith - (Printf.sprintf + failwith + (Printf.sprintf (f_ "Cannot parse field '%s' when setting value %S") nm s) @@ -474,8 +466,8 @@ print (get data) in - begin - match schema with + begin + match schema with | Some t -> Schema.add t nm sets gets extra help | None -> @@ -491,7 +483,7 @@ extra = extra; } - let fset data t ?context x = + let fset data t ?context x = t.set data ?context x let fget data t = @@ -501,7 +493,7 @@ t.sets data ?context s let fgets data t = - t.gets data + t.gets data end @@ -509,7 +501,7 @@ struct let create ?schema ?name ?parse ?print ?default ?update ?help extra = - let fld = + let fld = Field.create ?schema ?name ?parse ?print ?default ?update ?help extra in fun data -> Field.fget data fld @@ -518,20 +510,20 @@ end module OASISMessage = struct -# 21 "/Users/mmottl/Downloads/oasis/src/oasis/OASISMessage.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISMessage.ml" open OASISGettext open OASISContext let generic_message ~ctxt lvl fmt = - let cond = - match lvl with + let cond = + match lvl with | `Debug -> ctxt.debug | _ -> ctxt.verbose in - Printf.ksprintf - (fun str -> + Printf.ksprintf + (fun str -> if cond then begin ctxt.printf lvl str @@ -541,7 +533,7 @@ let debug ~ctxt fmt = generic_message ~ctxt `Debug fmt - let info ~ctxt fmt = + let info ~ctxt fmt = generic_message ~ctxt `Info fmt let warning ~ctxt fmt = @@ -550,24 +542,10 @@ let error ~ctxt fmt = generic_message ~ctxt `Error fmt - - let string_of_exception e = - try - PropList.string_of_exception e - with - | Failure s -> - s - | e -> - Printexc.to_string e - - (* TODO - let register_exn_printer f = - *) - end module OASISVersion = struct -# 21 "/Users/mmottl/Downloads/oasis/src/oasis/OASISVersion.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISVersion.ml" open OASISGettext @@ -577,7 +555,7 @@ type t = string - type comparator = + type comparator = | VGreater of t | VGreaterEqual of t | VEqual of t @@ -595,17 +573,17 @@ ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') let is_special = - function + function | '.' | '+' | '-' | '~' -> true | _ -> false let rec version_compare v1 v2 = if v1 <> "" || v2 <> "" then begin - (* Compare ascii string, using special meaning for version + (* Compare ascii string, using special meaning for version * related char *) - let val_ascii c = + let val_ascii c = if c = '~' then -1 else if is_digit c then 0 else if c = '\000' then 0 @@ -619,16 +597,16 @@ let p = ref 0 in (** Compare ascii part *) - let compare_vascii () = + let compare_vascii () = let cmp = ref 0 in - while !cmp = 0 && - !p < len1 && !p < len2 && - not (is_digit v1.[!p] && is_digit v2.[!p]) do + while !cmp = 0 && + !p < len1 && !p < len2 && + not (is_digit v1.[!p] && is_digit v2.[!p]) do cmp := (val_ascii v1.[!p]) - (val_ascii v2.[!p]); incr p done; if !cmp = 0 && !p < len1 && !p = len2 then - val_ascii v1.[!p] + val_ascii v1.[!p] else if !cmp = 0 && !p = len1 && !p < len2 then - (val_ascii v2.[!p]) else @@ -636,17 +614,21 @@ in (** Compare digit part *) - let compare_digit () = + let compare_digit () = let extract_int v p = let start_p = !p in - while !p < String.length v && is_digit v.[!p] do + while !p < String.length v && is_digit v.[!p] do incr p done; - match String.sub v start_p (!p - start_p) with - | "" -> 0, - v - | s -> int_of_string s, - String.sub v !p ((String.length v) - !p) + let substr = + String.sub v !p ((String.length v) - !p) + in + let res = + match String.sub v start_p (!p - start_p) with + | "" -> 0 + | s -> int_of_string s + in + res, substr in let i1, tl1 = extract_int v1 (ref !p) in let i2, tl2 = extract_int v2 (ref !p) in @@ -656,7 +638,7 @@ match compare_vascii () with | 0 -> begin - match compare_digit () with + match compare_digit () with | 0, tl1, tl2 -> if tl1 <> "" && is_digit tl1.[0] then 1 @@ -677,13 +659,13 @@ let version_of_string str = - String.iter + String.iter (fun c -> if is_alpha c || is_digit c || is_special c then () else failwith - (Printf.sprintf + (Printf.sprintf (f_ "Char %C is not allowed in version '%s'") c str)) str; @@ -692,10 +674,10 @@ let string_of_version t = t - let chop t = - try - let pos = - String.rindex t '.' + let chop t = + try + let pos = + String.rindex t '.' in String.sub t 0 pos with Not_found -> @@ -719,25 +701,25 @@ (comparator_apply v op1) && (comparator_apply v op2) let rec string_of_comparator = - function + function | VGreater v -> "> "^(string_of_version v) | VEqual v -> "= "^(string_of_version v) | VLesser v -> "< "^(string_of_version v) | VGreaterEqual v -> ">= "^(string_of_version v) | VLesserEqual v -> "<= "^(string_of_version v) - | VOr (c1, c2) -> + | VOr (c1, c2) -> (string_of_comparator c1)^" || "^(string_of_comparator c2) - | VAnd (c1, c2) -> + | VAnd (c1, c2) -> (string_of_comparator c1)^" && "^(string_of_comparator c2) let rec varname_of_comparator = - let concat p v = + let concat p v = OASISUtils.varname_concat - p - (OASISUtils.varname_of_string + p + (OASISUtils.varname_of_string (string_of_version v)) in - function + function | VGreater v -> concat "gt" v | VLesser v -> concat "lt" v | VEqual v -> concat "eq" v @@ -751,7 +733,7 @@ end module OASISLicense = struct -# 21 "/Users/mmottl/Downloads/oasis/src/oasis/OASISLicense.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISLicense.ml" (** License for _oasis fields @author Sylvain Le Gall @@ -763,13 +745,13 @@ type license_exception = string - type license_version = + type license_version = | Version of OASISVersion.t | VersionOrLater of OASISVersion.t | NoVersion - type license_dep_5 = + type license_dep_5 = { license: license; exceptions: license_exception list; @@ -784,7 +766,7 @@ end module OASISExpr = struct -# 21 "/Users/mmottl/Downloads/oasis/src/oasis/OASISExpr.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISExpr.ml" @@ -806,18 +788,18 @@ type 'a choices = (t * 'a) list let eval var_get t = - let rec eval' = + let rec eval' = function | EBool b -> b - | ENot e -> + | ENot e -> not (eval' e) | EAnd (e1, e2) -> (eval' e1) && (eval' e2) - | EOr (e1, e2) -> + | EOr (e1, e2) -> (eval' e1) || (eval' e2) | EFlag nm -> @@ -836,19 +818,19 @@ eval' t let choose ?printer ?name var_get lst = - let rec choose_aux = + let rec choose_aux = function | (cond, vl) :: tl -> - if eval var_get cond then - vl + if eval var_get cond then + vl else choose_aux tl | [] -> - let str_lst = + let str_lst = if lst = [] then s_ "" else - String.concat + String.concat (s_ ", ") (List.map (fun (cond, vl) -> @@ -857,10 +839,10 @@ | None -> s_ "") lst) in - match name with + match name with | Some nm -> failwith - (Printf.sprintf + (Printf.sprintf (f_ "No result for the choice list '%s': %s") nm str_lst) | None -> @@ -874,7 +856,7 @@ end module OASISTypes = struct -# 21 "/Users/mmottl/Downloads/oasis/src/oasis/OASISTypes.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISTypes.ml" @@ -900,34 +882,34 @@ | Best - type dependency = + type dependency = | FindlibPackage of findlib_full * OASISVersion.comparator option | InternalLibrary of name type tool = | ExternalTool of name - | InternalExecutable of name + | InternalExecutable of name - type vcs = - | Darcs - | Git - | Svn - | Cvs - | Hg - | Bzr - | Arch + type vcs = + | Darcs + | Git + | Svn + | Cvs + | Hg + | Bzr + | Arch | Monotone | OtherVCS of url - type plugin_kind = - [ `Configure - | `Build - | `Doc - | `Test - | `Install + type plugin_kind = + [ `Configure + | `Build + | `Doc + | `Test + | `Install | `Extra ] @@ -947,18 +929,18 @@ type 'a plugin = 'a * name * OASISVersion.t option - type all_plugin = plugin_kind plugin + type all_plugin = plugin_kind plugin type plugin_data = (all_plugin * plugin_data_purpose * (unit -> unit)) list -# 102 "/Users/mmottl/Downloads/oasis/src/oasis/OASISTypes.ml" +# 102 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISTypes.ml" type 'a conditional = 'a OASISExpr.choices - type custom = + type custom = { pre_command: (command_line option) conditional; - post_command: (command_line option) conditional; + post_command: (command_line option) conditional; } @@ -989,7 +971,7 @@ } - type library = + type library = { lib_modules: string list; lib_pack: bool; @@ -999,19 +981,19 @@ lib_findlib_containers: findlib_name list; } - type executable = + type executable = { exec_custom: bool; exec_main_is: unix_filename; } - type flag = + type flag = { flag_description: string option; flag_default: bool conditional; } - type source_repository = + type source_repository = { src_repo_type: vcs; src_repo_location: url; @@ -1022,7 +1004,7 @@ src_repo_subdir: unix_filename option; } - type test = + type test = { test_type: [`Test] plugin; test_command: command_line conditional; @@ -1109,7 +1091,7 @@ end module OASISUnixPath = struct -# 21 "/Users/mmottl/Downloads/oasis/src/oasis/OASISUnixPath.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISUnixPath.ml" type unix_filename = string type unix_dirname = string @@ -1121,7 +1103,7 @@ let parent_dir_name = ".." - let concat f1 f2 = + let concat f1 f2 = if f1 = current_dir_name then f2 else if f2 = current_dir_name then @@ -1146,7 +1128,7 @@ current_dir_name let basename f = - try + try let pos_start = (String.rindex f '/') + 1 in @@ -1155,14 +1137,14 @@ f let chop_extension f = - try + try let last_dot = String.rindex f '.' in let sub = String.sub f 0 last_dot in - try + try let last_slash = String.rindex f '/' in @@ -1176,19 +1158,22 @@ with Not_found -> f + let capitalize_file f = + let dir = dirname f in + let base = basename f in + concat dir (String.capitalize base) + + let uncapitalize_file f = + let dir = dirname f in + let base = basename f in + concat dir (String.uncapitalize base) end module OASISSection = struct -# 21 "/Users/mmottl/Downloads/oasis/src/oasis/OASISSection.ml" - - (** Manipulate section - @author Sylvain Le Gall - *) +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISSection.ml" open OASISTypes - (** Extract generic information - *) let section_kind_common = function | Library (cs, _, _) -> @@ -1204,13 +1189,9 @@ | Doc (cs, _) -> `Doc, cs - (** Common section of a section - *) let section_common sct = snd (section_kind_common sct) - (** Set the common part of a section - *) let section_common_set cs = function | Library (_, bs, lib) -> Library (cs, bs, lib) @@ -1244,12 +1225,12 @@ end module OASISBuildSection = struct -# 21 "/Users/mmottl/Downloads/oasis/src/oasis/OASISBuildSection.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISBuildSection.ml" end module OASISExecutable = struct -# 21 "/Users/mmottl/Downloads/oasis/src/oasis/OASISExecutable.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISExecutable.ml" open OASISTypes @@ -1280,7 +1261,7 @@ end module OASISLibrary = struct -# 21 "/Users/mmottl/Downloads/oasis/src/oasis/OASISLibrary.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISLibrary.ml" open OASISTypes open OASISUtils @@ -1288,43 +1269,110 @@ type library_name = name - let generated_unix_files ~ctxt (cs, bs, lib) - source_file_exists is_native ext_lib ext_dll = - (* The headers that should be compiled along *) - let headers = - if lib.lib_pack then - [] - else - List.fold_left - (fun hdrs modul -> - try - let base_fn = - List.find - (fun fn -> - source_file_exists (fn^".ml") || - source_file_exists (fn^".mli") || - source_file_exists (fn^".mll") || - source_file_exists (fn^".mly")) - (List.map - (OASISUnixPath.concat bs.bs_path) - [modul; - String.uncapitalize modul; - String.capitalize modul]) - in - [base_fn^".cmi"] :: hdrs - with Not_found -> + (* Look for a module file, considering capitalization or not. *) + let find_module source_file_exists (cs, bs, lib) modul = + let possible_base_fn = + List.map + (OASISUnixPath.concat bs.bs_path) + [modul; + OASISUnixPath.uncapitalize_file modul; + OASISUnixPath.capitalize_file modul] + in + (* TODO: we should be able to be able to determine the source for every + * files. Hence we should introduce a Module(source: fn) for the fields + * Modules and InternalModules + *) + List.fold_left + (fun acc base_fn -> + match acc with + | `No_sources _ -> + begin + let file_found = + List.fold_left + (fun acc ext -> + if source_file_exists (base_fn^ext) then + (base_fn^ext) :: acc + else + acc) + [] + [".ml"; ".mli"; ".mll"; ".mly"] + in + match file_found with + | [] -> + acc + | lst -> + `Sources (base_fn, lst) + end + | `Sources _ -> + acc) + (`No_sources possible_base_fn) + possible_base_fn + + let source_unix_files ~ctxt (cs, bs, lib) source_file_exists = + List.fold_left + (fun acc modul -> + match find_module source_file_exists (cs, bs, lib) modul with + | `Sources (base_fn, lst) -> + (base_fn, lst) :: acc + | `No_sources _ -> OASISMessage.warning ~ctxt (f_ "Cannot find source file matching \ module '%s' in library %s") modul cs.cs_name; - (List.map (OASISUnixPath.concat bs.bs_path) - [modul^".cmi"; - String.uncapitalize modul ^ ".cmi"; - String.capitalize modul ^ ".cmi"]) - :: hdrs) - [] + acc) + [] + (lib.lib_modules @ lib.lib_internal_modules) + + let generated_unix_files ~ctxt (cs, bs, lib) + source_file_exists is_native ext_lib ext_dll = + + let find_modules lst ext = + let find_module modul = + match find_module source_file_exists (cs, bs, lib) modul with + | `Sources (base_fn, _) -> + [base_fn] + | `No_sources lst -> + OASISMessage.warning + ~ctxt + (f_ "Cannot find source file matching \ + module '%s' in library %s") + modul cs.cs_name; + lst + in + List.map + (fun nm -> + List.map + (fun base_fn -> base_fn ^"."^ext) + (find_module nm)) + lst + in + + (* The headers that should be compiled along *) + let headers = + if lib.lib_pack then + [] + else + find_modules lib.lib_modules + "cmi" + in + + (* The .cmx that be compiled along *) + let cmxs = + let should_be_built = + (not lib.lib_pack) && (* Do not install .cmx packed submodules *) + match bs.bs_compiled_object with + | Native -> true + | Best -> is_native () + | Byte -> false + in + if should_be_built then + find_modules + (lib.lib_modules @ lib.lib_internal_modules) + "cmx" + else + [] in let acc_nopath = @@ -1346,7 +1394,7 @@ let native acc = add_pack_header ([cs.cs_name^".cmxa"] :: [cs.cs_name^(ext_lib ())] :: acc) in - match bs.bs_compiled_object with + match bs.bs_compiled_object with | Native -> byte (native acc_nopath) | Best when is_native () -> @@ -1356,7 +1404,7 @@ in (* Add C library to be built *) - let acc_nopath = + let acc_nopath = if bs.bs_c_sources <> [] then begin ["lib"^cs.cs_name^(ext_lib ())] @@ -1375,15 +1423,15 @@ (List.rev_map (OASISUnixPath.concat bs.bs_path)) acc_nopath) - headers + (headers @ cmxs) - type group_t = + type group_t = | Container of findlib_name * (group_t list) - | Package of (findlib_name * + | Package of (findlib_name * common_section * - build_section * - library * + build_section * + library * (group_t list)) let group_libs pkg = @@ -1394,11 +1442,11 @@ function | Library (cs, bs, lib) -> begin - match lib.lib_findlib_parent with + match lib.lib_findlib_parent with | Some p_nm -> begin let children = - try + try MapString.find p_nm mp with Not_found -> [] @@ -1416,7 +1464,7 @@ (* Compute findlib name of a single node *) let findlib_name (cs, _, lib) = - match lib.lib_findlib_name with + match lib.lib_findlib_name with | Some nm -> nm | None -> cs.cs_name in @@ -1427,15 +1475,12 @@ | hd :: tl -> Container (hd, [tree_of_library tl acc]) | [] -> - (* TODO: allow merging containers with the same - * name - *) Package (findlib_name acc, cs, bs, lib, - (try - List.rev_map + (try + List.rev_map (fun ((_, _, child_lib) as child_acc) -> - tree_of_library + tree_of_library child_lib.lib_findlib_containers child_acc) (MapString.find cs.cs_name children) @@ -1443,21 +1488,52 @@ [])) in + (** Merge containers with the same name *) + let rec merge_containers groups = + (* Collect packages and create the map "container name -> merged children" *) + let packages, containers = + List.fold_left + (fun (packages, containers) group -> + match group with + | Container(name, children) -> + let children' = + try + MapString.find name containers + with Not_found -> + [] + in + (packages, + MapString.add name (children' @ children) containers) + | Package(name, cs, bs, lib, children) -> + (Package(name, cs, bs, lib, merge_containers children) :: packages, + containers)) + ([], MapString.empty) + groups + in + (* Recreate the list of groups *) + packages @ + (MapString.fold + (fun name children acc -> + Container(name, merge_containers children) :: acc) + containers []) + in + (* TODO: check that libraries are unique *) - List.fold_left - (fun acc -> - function - | Library (cs, bs, lib) when lib.lib_findlib_parent = None -> - (tree_of_library lib.lib_findlib_containers (cs, bs, lib)) :: acc - | _ -> - acc) - [] - pkg.sections + merge_containers + (List.fold_left + (fun acc -> + function + | Library (cs, bs, lib) when lib.lib_findlib_parent = None -> + (tree_of_library lib.lib_findlib_containers (cs, bs, lib)) :: acc + | _ -> + acc) + [] + pkg.sections) (** Compute internal to findlib library matchings, including subpackage and return a map of it. *) - let findlib_name_map pkg = + let findlib_name_map pkg = (* Compute names in a tree *) let rec findlib_names_aux path mp grp = @@ -1465,7 +1541,7 @@ match grp with | Container (fndlb_nm, children) -> fndlb_nm, children, mp - + | Package (fndlb_nm, {cs_name = nm}, _, _, children) -> fndlb_nm, children, (MapString.add nm (path, fndlb_nm) mp) in @@ -1488,47 +1564,47 @@ let findlib_of_name ?(recurse=false) map nm = - try - let (path, fndlb_nm) = + try + let (path, fndlb_nm) = MapString.find nm map in - match path with + match path with | Some pth when recurse -> pth^"."^fndlb_nm | _ -> fndlb_nm with Not_found -> - failwithf1 + failwithf (f_ "Unable to translate internal library '%s' to findlib name") nm let name_findlib_map pkg = - let mp = + let mp = findlib_name_map pkg in MapString.fold - (fun nm _ acc -> + (fun nm _ acc -> let fndlb_nm_full = - findlib_of_name - ~recurse:true - mp + findlib_of_name + ~recurse:true + mp nm in MapString.add fndlb_nm_full nm acc) mp MapString.empty - let findlib_of_group = + let findlib_of_group = function - | Container (fndlb_nm, _) + | Container (fndlb_nm, _) | Package (fndlb_nm, _, _, _, _) -> fndlb_nm let root_of_group grp = let rec root_lib_aux = - function + function | Container (_, children) -> - root_lib_lst children + root_lib_lst children | Package (_, cs, bs, lib, children) -> - if lib.lib_findlib_parent = None then + if lib.lib_findlib_parent = None then cs, bs, lib else root_lib_lst children @@ -1545,7 +1621,7 @@ try root_lib_aux grp with Not_found -> - failwithf1 + failwithf (f_ "Unable to determine root library of findlib library '%s'") (findlib_of_group grp) @@ -1553,40 +1629,40 @@ end module OASISFlag = struct -# 21 "/Users/mmottl/Downloads/oasis/src/oasis/OASISFlag.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISFlag.ml" end module OASISPackage = struct -# 21 "/Users/mmottl/Downloads/oasis/src/oasis/OASISPackage.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISPackage.ml" end module OASISSourceRepository = struct -# 21 "/Users/mmottl/Downloads/oasis/src/oasis/OASISSourceRepository.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISSourceRepository.ml" end module OASISTest = struct -# 21 "/Users/mmottl/Downloads/oasis/src/oasis/OASISTest.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISTest.ml" end module OASISDocument = struct -# 21 "/Users/mmottl/Downloads/oasis/src/oasis/OASISDocument.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/oasis/OASISDocument.ml" end module BaseEnvLight = struct -# 21 "/Users/mmottl/Downloads/oasis/src/base/BaseEnvLight.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseEnvLight.ml" module MapString = Map.Make(String) type t = string MapString.t let default_filename = - Filename.concat + Filename.concat (Sys.getcwd ()) "setup.data" @@ -1602,23 +1678,23 @@ let line = ref 1 in - let st_line = + let st_line = Stream.from (fun _ -> try - match Stream.next st with + match Stream.next st with | '\n' -> incr line; Some '\n' | c -> Some c with Stream.Failure -> None) in - let lexer = + let lexer = Genlex.make_lexer ["="] st_line in let rec read_file mp = - match Stream.npeek 3 lexer with + match Stream.npeek 3 lexer with | [Genlex.Ident nm; Genlex.Kwd "="; Genlex.String value] -> - Stream.junk lexer; - Stream.junk lexer; + Stream.junk lexer; + Stream.junk lexer; Stream.junk lexer; read_file (MapString.add nm value mp) | [] -> @@ -1641,8 +1717,8 @@ end else begin - failwith - (Printf.sprintf + failwith + (Printf.sprintf "Unable to load environment, the file '%s' doesn't exist." filename) end @@ -1652,23 +1728,23 @@ let buff = Buffer.create ((String.length str) * 2) in - Buffer.add_substitute + Buffer.add_substitute buff - (fun var -> - try + (fun var -> + try var_expand (MapString.find var env) with Not_found -> - failwith - (Printf.sprintf + failwith + (Printf.sprintf "No variable %s defined when trying to expand %S." - var + var str)) str; Buffer.contents buff in var_expand (MapString.find name env) - let var_choose lst env = + let var_choose lst env = OASISExpr.choose (fun nm -> var_get nm env) lst @@ -1676,20 +1752,20 @@ module BaseContext = struct -# 21 "/Users/mmottl/Downloads/oasis/src/base/BaseContext.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseContext.ml" - open OASISContext + open OASISContext - let args = args + let args = args let default = default end module BaseMessage = struct -# 21 "/Users/mmottl/Downloads/oasis/src/base/BaseMessage.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseMessage.ml" - (** Message to user, overrid for Base + (** Message to user, overrid for Base @author Sylvain Le Gall *) open OASISMessage @@ -1703,12 +1779,10 @@ let error fmt = error ~ctxt:!default fmt - let string_of_exception = string_of_exception - end module BaseFilePath = struct -# 21 "/Users/mmottl/Downloads/oasis/src/base/BaseFilePath.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseFilePath.ml" open Filename @@ -1716,7 +1790,7 @@ module Unix = OASISUnixPath let make = - function + function | [] -> invalid_arg "BaseFilename.make" | hd :: tl -> @@ -1740,16 +1814,15 @@ end module BaseEnv = struct -# 21 "/Users/mmottl/Downloads/oasis/src/base/BaseEnv.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseEnv.ml" - open OASISTypes open OASISGettext open OASISUtils open PropList module MapString = BaseEnvLight.MapString - type origin_t = + type origin_t = | ODefault | OGetEnv | OFileLoad @@ -1775,36 +1848,36 @@ Schema.create "environment" (* Environment data *) - let env = + let env = Data.create () (* Environment data from file *) - let env_from_file = + let env_from_file = ref MapString.empty (* Lexer for var *) - let var_lxr = + let var_lxr = Genlex.make_lexer [] let rec var_expand str = let buff = Buffer.create ((String.length str) * 2) in - Buffer.add_substitute + Buffer.add_substitute buff - (fun var -> - try - (* TODO: this is a quick hack to allow calling Test.Command + (fun var -> + try + (* TODO: this is a quick hack to allow calling Test.Command * without defining executable name really. I.e. if there is * an exec Executable toto, then $(toto) should be replace * by its real name. It is however useful to have this function - * for other variable that depend on the host and should be + * for other variable that depend on the host and should be * written better than that. *) let st = var_lxr (Stream.of_string var) in - match Stream.npeek 3 st with + match Stream.npeek 3 st with | [Genlex.Ident "utoh"; Genlex.Ident nm] -> BaseFilePath.of_unix (var_get nm) | [Genlex.Ident "utoh"; Genlex.String s] -> @@ -1816,18 +1889,18 @@ | [Genlex.Ident nm] -> var_get nm | _ -> - failwithf2 + failwithf (f_ "Unknown expression '%s' in variable expansion of %s.") var str - with + with | Unknown_field (_, _) -> - failwithf2 + failwithf (f_ "No variable %s defined when trying to expand %S.") - var + var str - | Stream.Error e -> - failwithf3 + | Stream.Error e -> + failwithf (f_ "Syntax error when parsing '%s' when trying to \ expand %S: %s") var @@ -1837,12 +1910,12 @@ Buffer.contents buff and var_get name = - let vl = - try + let vl = + try Schema.get schema env name with Unknown_field _ as e -> begin - try + try MapString.find name !env_from_file with Not_found -> raise e @@ -1851,43 +1924,43 @@ var_expand vl let var_choose ?printer ?name lst = - OASISExpr.choose + OASISExpr.choose ?printer ?name - var_get + var_get lst - let var_protect vl = - let buff = + let var_protect vl = + let buff = Buffer.create (String.length vl) in String.iter - (function + (function | '$' -> Buffer.add_string buff "\\$" | c -> Buffer.add_char buff c) vl; Buffer.contents buff - let var_define - ?(hide=false) - ?(dump=true) + let var_define + ?(hide=false) + ?(dump=true) ?short_desc ?(cli=CLINone) ?arg_help - ?group + ?group name (* TODO: type constraint on the fact that name must be a valid OCaml id *) dflt = let default = [ - OFileLoad, lazy (MapString.find name !env_from_file); + OFileLoad, (fun () -> MapString.find name !env_from_file); ODefault, dflt; - OGetEnv, lazy (Sys.getenv name); + OGetEnv, (fun () -> Sys.getenv name); ] in - let extra = + let extra = { hide = hide; dump = dump; @@ -1897,16 +1970,16 @@ } in - (* Try to find a value that can be defined + (* Try to find a value that can be defined *) - let var_get_low lst = + let var_get_low lst = let errors, res = List.fold_left - (fun (errors, res) (_, v) -> + (fun (errors, res) (o, v) -> if res = None then begin - try - errors, Some (Lazy.force v) + try + errors, Some (v ()) with | Not_found -> errors, res @@ -1920,15 +1993,10 @@ ([], None) (List.sort (fun (o1, _) (o2, _) -> - if o1 < o2 then - 1 - else if o1 = o2 then - 0 - else - -1) + Pervasives.compare o2 o1) lst) in - match res, errors with + match res, errors with | Some v, _ -> v | None, [] -> @@ -1938,16 +2006,16 @@ in let help = - match short_desc with + match short_desc with | Some fs -> Some fs | None -> None in - let var_get_lst = + let var_get_lst = FieldRO.create ~schema ~name - ~parse:(fun ?(context=ODefault) s -> [context, lazy s]) + ~parse:(fun ?(context=ODefault) s -> [context, fun () -> s]) ~print:var_get_low ~default ~update:(fun ?context x old_x -> x @ old_x) @@ -1958,49 +2026,50 @@ fun () -> var_expand (var_get_low (var_get_lst env)) - let var_redefine + let var_redefine ?hide ?dump ?short_desc ?cli ?arg_help - ?group - name + ?group + name dflt = if Schema.mem schema name then begin - Schema.set schema env ~context:ODefault name (Lazy.force dflt); + (* TODO: look suspsicious, we want to memorize dflt not dflt () *) + Schema.set schema env ~context:ODefault name (dflt ()); fun () -> var_get name end else begin - var_define + var_define ?hide ?dump ?short_desc ?cli ?arg_help - ?group - name + ?group + name dflt end - let var_ignore (e : unit -> string) = + let var_ignore (e : unit -> string) = () let print_hidden = - var_define + var_define ~hide:true ~dump:false ~cli:CLIAuto ~arg_help:"Print even non-printable variable. (debug)" "print_hidden" - (lazy "false") + (fun () -> "false") let var_all () = List.rev (Schema.fold - (fun acc nm def _ -> + (fun acc nm def _ -> if not def.hide || bool_of_string (print_hidden ()) then nm :: acc else @@ -2014,48 +2083,59 @@ let load ?allow_empty ?filename () = env_from_file := BaseEnvLight.load ?allow_empty ?filename () - let unload () = - (* TODO: reset lazy values *) + let unload () = env_from_file := MapString.empty; Data.clear env - let dump ?(filename=default_filename) () = + let dump ?(filename=default_filename) () = let chn = open_out_bin filename in - Schema.iter - (fun nm def _ -> + let output nm value = + Printf.fprintf chn "%s=%S\n" nm value + in + let mp_todo = + (* Dump data from schema *) + Schema.fold + (fun mp_todo nm def _ -> if def.dump then begin - try + try let value = - Schema.get - schema - env + Schema.get + schema + env nm in - Printf.fprintf chn "%s = %S\n" nm value + output nm value with Not_set _ -> () - end) - schema; + end; + MapString.remove nm mp_todo) + !env_from_file + schema + in + (* Dump data defined outside of schema *) + MapString.iter output mp_todo; + + (* End of the dump *) close_out chn let print () = let printable_vars = Schema.fold - (fun acc nm def short_descr_opt -> + (fun acc nm def short_descr_opt -> if not def.hide || bool_of_string (print_hidden ()) then begin - try - let value = - Schema.get + try + let value = + Schema.get schema env nm in - let txt = - match short_descr_opt with + let txt = + match short_descr_opt with | Some s -> s () | None -> nm in @@ -2068,7 +2148,7 @@ [] schema in - let max_length = + let max_length = List.fold_left max 0 (List.rev_map String.length (List.rev_map fst printable_vars)) @@ -2077,15 +2157,12 @@ String.make ((max_length - (String.length str)) + 3) '.' in - print_newline (); - print_endline "Configuration: "; - print_newline (); - List.iter - (fun (name,value) -> - Printf.printf "%s: %s %s\n" name (dot_pad name) value) - printable_vars; - Printf.printf "%!"; - print_newline () + Printf.printf "\nConfiguration: \n"; + List.iter + (fun (name,value) -> + Printf.printf "%s: %s %s\n" name (dot_pad name) value) + (List.rev printable_vars); + Printf.printf "\n%!" let args () = let arg_concat = @@ -2102,12 +2179,12 @@ [ Arg.Set_string rvr; Arg.Set_string rvl; - Arg.Unit - (fun () -> - Schema.set + Arg.Unit + (fun () -> + Schema.set schema env - ~context:OCommandLine + ~context:OCommandLine !rvr !rvl) ] @@ -2116,51 +2193,51 @@ ] @ - List.flatten + List.flatten (Schema.fold (fun acc name def short_descr_opt -> - let var_set s = - Schema.set + let var_set s = + Schema.set schema env - ~context:OCommandLine + ~context:OCommandLine name s in - let arg_name = + let arg_name = OASISUtils.varname_of_string ~hyphen:'-' name in let hlp = - match short_descr_opt with + match short_descr_opt with | Some txt -> txt () | None -> "" in let arg_hlp = - match def.arg_help with + match def.arg_help with | Some s -> s | None -> "str" in - let default_value = - try - Printf.sprintf + let default_value = + try + Printf.sprintf (f_ " [%s]") (Schema.get schema env name) - with Not_set _ -> + with Not_set _ -> "" in - let args = - match def.cli with - | CLINone -> + let args = + match def.cli with + | CLINone -> [] - | CLIAuto -> + | CLIAuto -> [ arg_concat "--" arg_name, Arg.String var_set, @@ -2173,23 +2250,21 @@ Printf.sprintf (f_ "%s %s%s") arg_hlp hlp default_value ] | CLIEnable -> - [ - arg_concat "--enable-" arg_name, - Arg.Unit (fun () -> var_set "true"), - Printf.sprintf (f_ " %s%s") hlp - (if default_value = " [true]" then - (s_ " [default]") - else - ""); - - arg_concat "--disable-" arg_name, - Arg.Unit (fun () -> var_set "false"), - Printf.sprintf (f_ " %s%s") hlp - (if default_value = " [false]" then - (s_ " [default]") - else - ""); - ] + let dflt = + if default_value = " [true]" then + s_ " [default: enabled]" + else + s_ " [default: disabled]" + in + [ + arg_concat "--enable-" arg_name, + Arg.Unit (fun () -> var_set "true"), + Printf.sprintf (f_ " %s%s") hlp dflt; + + arg_concat "--disable-" arg_name, + Arg.Unit (fun () -> var_set "false"), + Printf.sprintf (f_ " %s%s") hlp dflt + ] | CLIUser lst -> lst in @@ -2199,7 +2274,7 @@ end module BaseExec = struct -# 21 "/Users/mmottl/Downloads/oasis/src/base/BaseExec.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseExec.ml" open OASISGettext open OASISUtils @@ -2210,22 +2285,22 @@ String.concat " " (cmd :: args) in info (f_ "Running command '%s'") cmdline; - match f_exit_code, Sys.command cmdline with + match f_exit_code, Sys.command cmdline with | None, 0 -> () | None, i -> - failwithf2 + failwithf (f_ "Command '%s' terminated with error code %d") cmdline i - | Some f, i -> + | Some f, i -> f i - let run_read_output cmd args = - let fn = + let run_read_output ?f_exit_code cmd args = + let fn = Filename.temp_file "oasis-" ".txt" in - let () = + let () = try - run cmd (args @ [">"; Filename.quote fn]) + run ?f_exit_code cmd (args @ [">"; Filename.quote fn]) with e -> Sys.remove fn; raise e @@ -2238,7 +2313,7 @@ in ( try - while true do + while true do routput := (input_line chn) :: !routput done with End_of_file -> @@ -2248,40 +2323,40 @@ Sys.remove fn; List.rev !routput - let run_read_one_line cmd args = - match run_read_output cmd args with - | [fst] -> + let run_read_one_line ?f_exit_code cmd args = + match run_read_output ?f_exit_code cmd args with + | [fst] -> fst - | lst -> - failwithf1 + | lst -> + failwithf (f_ "Command return unexpected output %S") (String.concat "\n" lst) end module BaseFileUtil = struct -# 21 "/Users/mmottl/Downloads/oasis/src/base/BaseFileUtil.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseFileUtil.ml" open OASISGettext - let find_file paths exts = + let find_file paths exts = (* Cardinal product of two list *) - let ( * ) lst1 lst2 = - List.flatten - (List.map - (fun a -> - List.map - (fun b -> a,b) - lst2) + let ( * ) lst1 lst2 = + List.flatten + (List.map + (fun a -> + List.map + (fun b -> a,b) + lst2) lst1) in - let rec combined_paths lst = + let rec combined_paths lst = match lst with | p1 :: p2 :: tl -> - let acc = - (List.map - (fun (a,b) -> Filename.concat a b) + let acc = + (List.map + (fun (a,b) -> Filename.concat a b) (p1 * p2)) in combined_paths (acc :: tl) @@ -2292,51 +2367,51 @@ in let alternatives = - List.map - (fun (p,e) -> + List.map + (fun (p,e) -> if String.length e > 0 && e.[0] <> '.' then p ^ "." ^ e else - p ^ e) + p ^ e) ((combined_paths paths) * exts) in - List.find + List.find Sys.file_exists alternatives let which prg = let path_sep = - match Sys.os_type with + match Sys.os_type with | "Win32" -> ';' | _ -> ':' in let path_lst = - OASISUtils.split - path_sep + OASISUtils.split + path_sep (Sys.getenv "PATH") in - let exec_ext = - match Sys.os_type with + let exec_ext = + match Sys.os_type with | "Win32" -> - "" - :: - (OASISUtils.split - path_sep + "" + :: + (OASISUtils.split + path_sep (Sys.getenv "PATHEXT")) | _ -> [""] in - find_file [path_lst; [prg]] exec_ext + find_file [path_lst; [prg]] exec_ext (**/**) - let rec fix_dir dn = - (* Windows hack because Sys.file_exists "src\\" = false when + let rec fix_dir dn = + (* Windows hack because Sys.file_exists "src\\" = false when * Sys.file_exists "src" = true *) - let ln = - String.length dn + let ln = + String.length dn in if Sys.os_type = "Win32" && ln > 0 && dn.[ln - 1] = '\\' then fix_dir (String.sub dn 0 (ln - 1)) @@ -2346,28 +2421,28 @@ let q = Filename.quote (**/**) - let cp src tgt = + let cp src tgt = BaseExec.run - (match Sys.os_type with + (match Sys.os_type with | "Win32" -> "copy" | _ -> "cp") [q src; q tgt] let mkdir tgt = - BaseExec.run - (match Sys.os_type with - | "Win32" -> "md" + BaseExec.run + (match Sys.os_type with + | "Win32" -> "md" | _ -> "mkdir") [q tgt] let rec mkdir_parent f tgt = - let tgt = + let tgt = fix_dir tgt in if Sys.file_exists tgt then begin if not (Sys.is_directory tgt) then - OASISUtils.failwithf1 + OASISUtils.failwithf (f_ "Cannot create directory '%s', a file of the same name already \ exists") tgt @@ -2375,7 +2450,7 @@ else begin mkdir_parent f (Filename.dirname tgt); - if not (Sys.file_exists tgt) then + if not (Sys.file_exists tgt) then begin f tgt; mkdir tgt @@ -2385,15 +2460,15 @@ let rmdir tgt = if Sys.readdir tgt = [||] then begin - match Sys.os_type with + match Sys.os_type with | "Win32" -> BaseExec.run "rd" [q tgt] | _ -> BaseExec.run "rm" ["-r"; q tgt] end - let glob fn = - let basename = + let glob fn = + let basename = Filename.basename fn in if String.length basename >= 2 && @@ -2403,7 +2478,7 @@ let ext_len = (String.length basename) - 2 in - let ext = + let ext = String.sub basename 2 ext_len in let dirname = @@ -2411,11 +2486,11 @@ in Array.fold_left (fun acc fn -> - try - let fn_ext = - String.sub - fn - ((String.length fn) - ext_len) + try + let fn_ext = + String.sub + fn + ((String.length fn) - ext_len) ext_len in if fn_ext = ext then @@ -2437,7 +2512,7 @@ end module BaseArgExt = struct -# 21 "/Users/mmottl/Downloads/oasis/src/base/BaseArgExt.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseArgExt.ml" open OASISUtils open OASISGettext @@ -2453,9 +2528,9 @@ ~current:current (Array.concat [[|"none"|]; argv]) (Arg.align args) - (failwithf1 (f_ "Don't know what to do with arguments: '%s'")) + (failwithf (f_ "Don't know what to do with arguments: '%s'")) (s_ "configure options:") - with + with | Arg.Help txt -> print_endline txt; exit 0 @@ -2465,7 +2540,7 @@ end module BaseCheck = struct -# 21 "/Users/mmottl/Downloads/oasis/src/base/BaseCheck.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseCheck.ml" open BaseEnv open BaseMessage @@ -2474,89 +2549,89 @@ let prog_best prg prg_lst = var_redefine - prg - (lazy - (let alternate = - List.fold_left - (fun res e -> - match res with - | Some _ -> - res - | None -> - try - Some (BaseFileUtil.which e) - with Not_found -> - None) - None - prg_lst - in - match alternate with - | Some prg -> prg - | None -> raise Not_found)) + prg + (fun () -> + let alternate = + List.fold_left + (fun res e -> + match res with + | Some _ -> + res + | None -> + try + Some (BaseFileUtil.which e) + with Not_found -> + None) + None + prg_lst + in + match alternate with + | Some prg -> prg + | None -> raise Not_found) let prog prg = prog_best prg [prg] - let prog_opt prg = + let prog_opt prg = prog_best prg [prg^".opt"; prg] - let ocamlfind = + let ocamlfind = prog "ocamlfind" - let version - var_prefix + let version + var_prefix cmp - fversion - () = + fversion + () = (* Really compare version provided *) - let var = + let var = var_prefix^"_version_"^(OASISVersion.varname_of_comparator cmp) in - var_redefine - ~hide:true + var_redefine + ~hide:true var - (lazy - (let version_str = - match fversion () with - | "[Distributed with OCaml]" -> - begin - try - (var_get "ocaml_version") - with Not_found -> - warning - (f_ "Variable ocaml_version not defined, fallback \ - to default"); - Sys.ocaml_version - end - | res -> - res - in - let version = - OASISVersion.version_of_string version_str - in - if OASISVersion.comparator_apply version cmp then - version_str - else - failwithf3 - (f_ "Cannot satisfy version constraint on %s: %s (version: %s)") - var_prefix - (OASISVersion.string_of_comparator cmp) - version_str)) + (fun () -> + let version_str = + match fversion () with + | "[Distributed with OCaml]" -> + begin + try + (var_get "ocaml_version") + with Not_found -> + warning + (f_ "Variable ocaml_version not defined, fallback \ + to default"); + Sys.ocaml_version + end + | res -> + res + in + let version = + OASISVersion.version_of_string version_str + in + if OASISVersion.comparator_apply version cmp then + version_str + else + failwithf + (f_ "Cannot satisfy version constraint on %s: %s (version: %s)") + var_prefix + (OASISVersion.string_of_comparator cmp) + version_str) () let package_version pkg = - BaseExec.run_read_one_line + BaseExec.run_read_one_line (ocamlfind ()) ["query"; "-format"; "%v"; pkg] let package ?version_comparator pkg () = let var = - OASISUtils.varname_concat - "pkg_" + OASISUtils.varname_concat + "pkg_" (OASISUtils.varname_of_string pkg) in - let findlib_dir pkg = - let dir = + let findlib_dir pkg = + let dir = BaseExec.run_read_one_line (ocamlfind ()) ["query"; "-format"; "%d"; pkg] @@ -2564,7 +2639,7 @@ if Sys.file_exists dir && Sys.is_directory dir then dir else - failwithf2 + failwithf (f_ "When looking for findlib package %s, \ directory %s return doesn't exist") pkg dir @@ -2572,26 +2647,26 @@ let vl = var_redefine var - (lazy (findlib_dir pkg)) + (fun () -> findlib_dir pkg) () in ( - match version_comparator with + match version_comparator with | Some ver_cmp -> ignore - (version + (version var ver_cmp (fun _ -> package_version pkg) ()) - | None -> + | None -> () ); vl end module BaseOCamlcConfig = struct -# 21 "/Users/mmottl/Downloads/oasis/src/base/BaseOCamlcConfig.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseOCamlcConfig.ml" open BaseEnv @@ -2600,34 +2675,34 @@ module SMap = Map.Make(String) - let ocamlc = + let ocamlc = BaseCheck.prog_opt "ocamlc" let ocamlc_config_map = - (* Map name to value for ocamlc -config output - (name ^": "^value) + (* Map name to value for ocamlc -config output + (name ^": "^value) *) - let rec split_field mp lst = - match lst with + let rec split_field mp lst = + match lst with | line :: tl -> let mp = try let pos_semicolon = String.index line ':' in - if pos_semicolon > 1 then + if pos_semicolon > 1 then ( let name = - String.sub line 0 pos_semicolon + String.sub line 0 pos_semicolon in let linelen = String.length line in let value = if linelen > pos_semicolon + 2 then - String.sub - line - (pos_semicolon + 2) + String.sub + line + (pos_semicolon + 2) (linelen - pos_semicolon - 2) else "" @@ -2648,52 +2723,65 @@ mp in + let cache = + lazy + (var_protect + (Marshal.to_string + (split_field + SMap.empty + (BaseExec.run_read_output + (ocamlc ()) ["-config"])) + [])) + in var_redefine "ocamlc_config_map" ~hide:true ~dump:false - (lazy - (var_protect - (Marshal.to_string - (split_field - SMap.empty - (BaseExec.run_read_output - (ocamlc ()) ["-config"])) - []))) + (fun () -> + (* TODO: update if ocamlc change !!! *) + Lazy.force cache) let var_define nm = (* Extract data from ocamlc -config *) - let avlbl_config_get () = - Marshal.from_string + let avlbl_config_get () = + Marshal.from_string (ocamlc_config_map ()) 0 in - let nm_config = - match nm with - | "ocaml_version" -> "version" - | _ -> nm + let chop_version_suffix s = + try + String.sub s 0 (String.index s '+') + with _ -> + s + in + + let nm_config, value_config = + match nm with + | "ocaml_version" -> + "version", chop_version_suffix + | _ -> nm, (fun x -> x) in var_redefine - nm - (lazy - (try - let map = - avlbl_config_get () - in - let value = - SMap.find nm_config map - in - value - with Not_found -> - failwithf2 - (f_ "Cannot find field '%s' in '%s -config' output") - nm - (ocamlc ()))) + nm + (fun () -> + try + let map = + avlbl_config_get () + in + let value = + SMap.find nm_config map + in + value_config value + with Not_found -> + failwithf + (f_ "Cannot find field '%s' in '%s -config' output") + nm + (ocamlc ())) end module BaseStandardVar = struct -# 21 "/Users/mmottl/Downloads/oasis/src/base/BaseStandardVar.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseStandardVar.ml" open OASISGettext @@ -2709,29 +2797,29 @@ (**/**) - let rpkg = + let rpkg = ref None let pkg_get () = - match !rpkg with + match !rpkg with | Some pkg -> pkg | None -> failwith (s_ "OASIS Package is not set") (**/**) - let pkg_name = + let pkg_name = var_define ~short_desc:(fun () -> s_ "Package name") "pkg_name" - (lazy (pkg_get ()).name) + (fun () -> (pkg_get ()).name) let pkg_version = var_define ~short_desc:(fun () -> s_ "Package version") "pkg_version" - (lazy + (fun () -> (OASISVersion.string_of_version (pkg_get ()).version)) - let c = BaseOCamlcConfig.var_define + let c = BaseOCamlcConfig.var_define let os_type = c "os_type" let system = c "system" @@ -2756,204 +2844,219 @@ (**/**) - let p name hlp dflt = + let p name hlp dflt = var_define - ~short_desc:hlp - ~cli:CLIAuto - ~arg_help:"dir" - name - dflt + ~short_desc:hlp + ~cli:CLIAuto + ~arg_help:"dir" + name + dflt - let (/) a b = + let (/) a b = if os_type () = Sys.os_type then - Filename.concat a b + Filename.concat a b else if os_type () = "Unix" then - BaseFilePath.Unix.concat a b + BaseFilePath.Unix.concat a b else - OASISUtils.failwithf1 - (f_ "Cannot handle os_type %s filename concat") + OASISUtils.failwithf (f_ "Cannot handle os_type %s filename concat") (os_type ()) (**/**) - let prefix = + let prefix = p "prefix" (fun () -> s_ "Install architecture-independent files dir") - (lazy - (match os_type () with - | "Win32" -> - let program_files = - Sys.getenv "PROGRAMFILES" - in - program_files/(pkg_name ()) - | _ -> - "/usr/local")) + (fun () -> + match os_type () with + | "Win32" -> + let program_files = + Sys.getenv "PROGRAMFILES" + in + program_files/(pkg_name ()) + | _ -> + "/usr/local") - let exec_prefix = + let exec_prefix = p "exec_prefix" (fun () -> s_ "Install architecture-dependent files in dir") - (lazy "$prefix") + (fun () -> "$prefix") let bindir = p "bindir" (fun () -> s_ "User executables") - (lazy ("$exec_prefix"/"bin")) + (fun () -> "$exec_prefix"/"bin") let sbindir = p "sbindir" (fun () -> s_ "System admin executables") - (lazy ("$exec_prefix"/"sbin")) + (fun () -> "$exec_prefix"/"sbin") let libexecdir = p "libexecdir" (fun () -> s_ "Program executables") - (lazy ("$exec_prefix"/"libexec")) + (fun () -> "$exec_prefix"/"libexec") let sysconfdir = p "sysconfdir" (fun () -> s_ "Read-only single-machine data") - (lazy ("$prefix"/"etc")) + (fun () -> "$prefix"/"etc") let sharedstatedir = p "sharedstatedir" (fun () -> s_ "Modifiable architecture-independent data") - (lazy ("$prefix"/"com")) + (fun () -> "$prefix"/"com") let localstatedir = p "localstatedir" (fun () -> s_ "Modifiable single-machine data") - (lazy ("$prefix"/"var")) + (fun () -> "$prefix"/"var") let libdir = p "libdir" (fun () -> s_ "Object code libraries") - (lazy ("$exec_prefix"/"lib")) + (fun () -> "$exec_prefix"/"lib") let datarootdir = p "datarootdir" (fun () -> s_ "Read-only arch-independent data root") - (lazy ("$prefix"/"share")) + (fun () -> "$prefix"/"share") let datadir = p "datadir" (fun () -> s_ "Read-only architecture-independent data") - (lazy ("$datarootdir")) + (fun () -> "$datarootdir") let infodir = p "infodir" (fun () -> s_ "Info documentation") - (lazy ("$datarootdir"/"info")) + (fun () -> "$datarootdir"/"info") let localedir = p "localedir" (fun () -> s_ "Locale-dependent data") - (lazy ("$datarootdir"/"locale")) + (fun () -> "$datarootdir"/"locale") let mandir = p "mandir" (fun () -> s_ "Man documentation") - (lazy ("$datarootdir"/"man")) + (fun () -> "$datarootdir"/"man") let docdir = p "docdir" (fun () -> s_ "Documentation root") - (lazy ("$datarootdir"/"doc"/"$pkg_name")) + (fun () -> "$datarootdir"/"doc"/"$pkg_name") let htmldir = p "htmldir" (fun () -> s_ "HTML documentation") - (lazy ("$docdir")) + (fun () -> "$docdir") let dvidir = p "dvidir" (fun () -> s_ "DVI documentation") - (lazy ("$docdir")) + (fun () -> "$docdir") let pdfdir = p "pdfdir" (fun () -> s_ "PDF documentation") - (lazy ("$docdir")) + (fun () -> "$docdir") let psdir = p "psdir" (fun () -> s_ "PS documentation") - (lazy ("$docdir")) + (fun () -> "$docdir") let destdir = p "destdir" (fun () -> s_ "Prepend a path when installing package") - (lazy - (raise - (PropList.Not_set - ("destdir", - Some (s_ "undefined by construct"))))) + (fun () -> + raise + (PropList.Not_set + ("destdir", + Some (s_ "undefined by construct")))) let findlib_version = var_define "findlib_version" - (lazy - (BaseCheck.package_version "findlib")) + (fun () -> + BaseCheck.package_version "findlib") let is_native = var_define "is_native" - (lazy - (try - let _s : string = - ocamlopt () - in - "true" - with PropList.Not_set _ -> - let _s : string = - ocamlc () - in - "false")) + (fun () -> + try + let _s : string = + ocamlopt () + in + "true" + with PropList.Not_set _ -> + let _s : string = + ocamlc () + in + "false") let ext_program = var_define "suffix_program" - (lazy - (match os_type () with - | "Win32" -> ".exe" - | _ -> "" - )) + (fun () -> + match os_type () with + | "Win32" -> ".exe" + | _ -> "") let rm = var_define ~short_desc:(fun () -> s_ "Remove a file.") "rm" - (lazy - (match os_type () with - | "Win32" -> "del" - | _ -> "rm -f")) + (fun () -> + match os_type () with + | "Win32" -> "del" + | _ -> "rm -f") let rmdir = var_define ~short_desc:(fun () -> s_ "Remove a directory.") "rmdir" - (lazy - (match os_type () with - | "Win32" -> "rd" - | _ -> "rm -rf")) + (fun () -> + match os_type () with + | "Win32" -> "rd" + | _ -> "rm -rf") let debug = var_define - ~short_desc:(fun () -> s_ "Compile with ocaml debug flag on.") + ~short_desc:(fun () -> s_ "Turn ocaml debug flag on") + ~cli:CLIEnable "debug" - (lazy "true") + (fun () -> "true") let profile = var_define - ~short_desc:(fun () -> s_ "Compile with ocaml profile flag on.") + ~short_desc:(fun () -> s_ "Turn ocaml profile flag on") + ~cli:CLIEnable "profile" - (lazy "false") + (fun () -> "false") - let init pkg = + let tests = + var_define + ~short_desc:(fun () -> + s_ "Compile tests executable and library and run them") + ~cli:CLIEnable + "tests" + (fun () -> "false") + + let docs = + var_define + ~short_desc:(fun () -> s_ "Create documentations") + ~cli:CLIEnable + "docs" + (fun () -> "true") + + let init pkg = rpkg := Some pkg end module BaseFileAB = struct -# 21 "/Users/mmottl/Downloads/oasis/src/base/BaseFileAB.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseFileAB.ml" open BaseEnv open OASISGettext @@ -2964,7 +3067,7 @@ BaseFilePath.of_unix fn in if not (Filename.check_suffix fn ".ab") then - warning + warning (f_ "File '%s' doesn't have '.ab' extension") fn; Filename.chop_extension fn @@ -3001,42 +3104,42 @@ end module BaseLog = struct -# 21 "/Users/mmottl/Downloads/oasis/src/base/BaseLog.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseLog.ml" open OASISUtils let default_filename = - Filename.concat + Filename.concat (Filename.dirname BaseEnv.default_filename) "setup.log" module SetTupleString = Set.Make - (struct + (struct type t = string * string - let compare (s11, s12) (s21, s22) = - match String.compare s11 s21 with + let compare (s11, s12) (s21, s22) = + match String.compare s11 s21 with | 0 -> String.compare s12 s22 | n -> n end) - let load () = + let load () = if Sys.file_exists default_filename then begin - let chn = + let chn = open_in default_filename in - let scbuf = + let scbuf = Scanf.Scanning.from_file default_filename in let rec read_aux (st, lst) = if not (Scanf.Scanning.end_of_input scbuf) then begin - let acc = - try - Scanf.bscanf scbuf "%S %S@\n" - (fun e d -> - let t = + let acc = + try + Scanf.bscanf scbuf "%S %S\n" + (fun e d -> + let t = e, d in if SetTupleString.mem t st then @@ -3045,9 +3148,9 @@ SetTupleString.add t st, t :: lst) with Scanf.Scan_failure _ -> - failwith + failwith (Scanf.bscanf scbuf - "%l" + "%l" (fun line -> Printf.sprintf "Malformed log file '%s' at line %d" @@ -3079,7 +3182,7 @@ let unregister event data = if Sys.file_exists default_filename then begin - let lst = + let lst = load () in let chn_out = @@ -3088,7 +3191,7 @@ let write_something = ref false in - List.iter + List.iter (fun (e, d) -> if e <> event || d <> data then begin @@ -3104,12 +3207,12 @@ let filter events = let st_events = List.fold_left - (fun st e -> + (fun st e -> SetString.add e st) SetString.empty events in - List.filter + List.filter (fun (e, _) -> SetString.mem e st_events) (load ()) @@ -3120,7 +3223,7 @@ end module BaseBuilt = struct -# 21 "/Users/mmottl/Downloads/oasis/src/base/BaseBuilt.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseBuilt.ml" open OASISTypes open OASISGettext @@ -3135,7 +3238,7 @@ let to_log_event_file t nm = "built_"^ - (match t with + (match t with | BExec -> "exec" | BExecLib -> "exec_lib" | BLib -> "lib" @@ -3145,22 +3248,22 @@ let to_log_event_done t nm = "is_"^(to_log_event_file t nm) - let register t nm lst = + let register t nm lst = BaseLog.register (to_log_event_done t nm) "true"; List.iter (fun alt -> - let registered = + let registered = List.fold_left (fun registered fn -> if Sys.file_exists fn then begin - BaseLog.register + BaseLog.register (to_log_event_file t nm) (if Filename.is_relative fn then Filename.concat (Sys.getcwd ()) fn - else + else fn); true end @@ -3179,12 +3282,12 @@ List.iter (fun (e, d) -> BaseLog.unregister e d) - (BaseLog.filter - [to_log_event_file t nm; + (BaseLog.filter + [to_log_event_file t nm; to_log_event_done t nm]) - let fold t nm f acc = - List.fold_left + let fold t nm f acc = + List.fold_left (fun acc (_, fn) -> if Sys.file_exists fn then begin @@ -3192,13 +3295,13 @@ end else begin - warning + warning (f_ "File '%s' has been marked as built \ for %s but doesn't exist") fn (Printf.sprintf - (match t with - | BExec | BExecLib -> + (match t with + | BExec | BExecLib -> (f_ "executable %s") | BLib -> (f_ "library %s") @@ -3214,7 +3317,7 @@ let is_built t nm = List.fold_left (fun is_built (_, d) -> - (try + (try bool_of_string d with _ -> false)) @@ -3222,17 +3325,17 @@ (BaseLog.filter [to_log_event_done t nm]) - let of_executable ffn (cs, bs, exec) = - let unix_exec_is, unix_dll_opt = - OASISExecutable.unix_exec_is + let of_executable ffn (cs, bs, exec) = + let unix_exec_is, unix_dll_opt = + OASISExecutable.unix_exec_is (cs, bs, exec) - (fun () -> - bool_of_string + (fun () -> + bool_of_string (is_native ())) ext_dll ext_program in - let evs = + let evs = (BExec, cs.cs_name, [[ffn unix_exec_is]]) :: (match unix_dll_opt with @@ -3245,8 +3348,8 @@ unix_exec_is, unix_dll_opt - let of_library ffn (cs, bs, lib) = - let unix_lst = + let of_library ffn (cs, bs, lib) = + let unix_lst = OASISLibrary.generated_unix_files ~ctxt:!BaseContext.default (cs, bs, lib) @@ -3267,7 +3370,7 @@ end module BaseCustom = struct -# 21 "/Users/mmottl/Downloads/oasis/src/base/BaseCustom.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseCustom.ml" open BaseEnv open BaseMessage @@ -3275,33 +3378,33 @@ open OASISGettext let run cmd args extra_args = - BaseExec.run + BaseExec.run (var_expand cmd) - (List.map + (List.map var_expand (args @ (Array.to_list extra_args))) let hook ?(failsafe=false) cstm f e = - let optional_command lst = + let optional_command lst = let printer = - function + function | Some (cmd, args) -> String.concat " " (cmd :: args) | None -> s_ "No command" in - match - var_choose + match + var_choose ~name:(s_ "Pre/Post Command") - ~printer - lst with + ~printer + lst with | Some (cmd, args) -> begin - try + try run cmd args [||] with e when failsafe -> - warning + warning (f_ "Command '%s' fail with error: %s") (String.concat " " (cmd :: args)) - (match e with + (match e with | Failure msg -> msg | e -> Printexc.to_string e) end @@ -3317,7 +3420,7 @@ end module BaseDynVar = struct -# 21 "/Users/mmottl/Downloads/oasis/src/base/BaseDynVar.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseDynVar.ml" open OASISTypes @@ -3326,34 +3429,35 @@ open BaseBuilt let init pkg = - List.iter + List.iter (function | Executable (cs, bs, exec) -> - var_ignore - (var_redefine - (* We don't save this variable *) - ~dump:false - ~short_desc:(fun () -> - Printf.sprintf - (f_ "Filename of executable '%s'") - cs.cs_name) - cs.cs_name - (lazy - (let fn_opt = - fold - BExec cs.cs_name - (fun _ fn -> Some fn) - None - in - match fn_opt with - | Some fn -> fn - | None -> - raise - (PropList.Not_set - (cs.cs_name, - Some (Printf.sprintf - (f_ "Executable '%s' not yet built.") - cs.cs_name)))))) + if var_choose bs.bs_build then + var_ignore + (var_redefine + (* We don't save this variable *) + ~dump:false + ~short_desc:(fun () -> + Printf.sprintf + (f_ "Filename of executable '%s'") + cs.cs_name) + cs.cs_name + (fun () -> + let fn_opt = + fold + BExec cs.cs_name + (fun _ fn -> Some fn) + None + in + match fn_opt with + | Some fn -> fn + | None -> + raise + (PropList.Not_set + (cs.cs_name, + Some (Printf.sprintf + (f_ "Executable '%s' not yet built.") + cs.cs_name))))) | Library _ | Flag _ | Test _ | SrcRepo _ | Doc _ -> ()) @@ -3361,7 +3465,7 @@ end module BaseTest = struct -# 21 "/Users/mmottl/Downloads/oasis/src/base/BaseTest.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseTest.ml" open BaseEnv open BaseMessage @@ -3372,20 +3476,20 @@ let test lst pkg extra_args = let one_test (failure, n) (test_plugin, cs, test) = - if var_choose + if var_choose ~name:(Printf.sprintf (f_ "test %s run") cs.cs_name) ~printer:string_of_bool test.test_run then begin - let () = + let () = info (f_ "Running test '%s'") cs.cs_name in - let back_cwd = - match test.test_working_directory with - | Some dir -> - let cwd = + let back_cwd = + match test.test_working_directory with + | Some dir -> + let cwd = Sys.getcwd () in let chdir d = @@ -3395,15 +3499,15 @@ chdir dir; fun () -> chdir cwd - | None -> + | None -> fun () -> () in - try + try let failure_percent = - BaseCustom.hook + BaseCustom.hook test.test_custom (test_plugin pkg (cs, test)) - extra_args + extra_args in back_cwd (); (failure_percent +. failure, n + 1) @@ -3431,7 +3535,7 @@ else failed /. (float_of_int n) in - let msg = + let msg = Printf.sprintf (f_ "Tests had a %.2f%% failure rate") (100. *. failure_percent) @@ -3443,7 +3547,7 @@ end module BaseDoc = struct -# 21 "/Users/mmottl/Downloads/oasis/src/base/BaseDoc.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseDoc.ml" open BaseEnv open BaseMessage @@ -3452,10 +3556,10 @@ let doc lst pkg extra_args = - let one_doc (doc_plugin, cs, doc) = - if var_choose - ~name:(Printf.sprintf - (f_ "documentation %s build") + let one_doc (doc_plugin, cs, doc) = + if var_choose + ~name:(Printf.sprintf + (f_ "documentation %s build") cs.cs_name) ~printer:string_of_bool doc.doc_build then @@ -3467,13 +3571,13 @@ extra_args end in - List.iter + List.iter one_doc lst end module BaseSetup = struct -# 21 "/Users/mmottl/Downloads/oasis/src/base/BaseSetup.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseSetup.ml" open BaseEnv open BaseMessage @@ -3482,10 +3586,10 @@ open OASISGettext open OASISUtils - type std_args_fun = + type std_args_fun = package -> string array -> unit - type ('a, 'b) section_args_fun = + type ('a, 'b) section_args_fun = name * (package -> (common_section * 'a) -> string array -> 'b) type t = @@ -3504,14 +3608,14 @@ distclean_test: (test, unit) section_args_fun list; package: package; version: string; - } + } (* Associate a plugin function with data from package *) let join_plugin_sections filter_map lst = List.rev (List.fold_left (fun acc sct -> - match filter_map sct with + match filter_map sct with | Some e -> e :: acc | None -> @@ -3521,26 +3625,43 @@ (* Search for plugin data associated with a section name *) let lookup_plugin_section plugin action nm lst = - try + try List.assoc nm lst with Not_found -> - failwithf3 + failwithf (f_ "Cannot find plugin %s matching section %s for %s action") plugin nm action - let configure t args = + let configure t args = (* Run configure *) - BaseCustom.hook + BaseCustom.hook t.package.conf_custom - (t.configure t.package) - args; + (fun () -> + (* Reload if preconf has changed it *) + begin + try + unload (); + load (); + with _ -> + () + end; + + (* Run plugin's configure *) + t.configure t.package args; + + (* Dump to allow postconf to change it *) + dump ()) + (); (* Reload environment *) unload (); load (); + (* Save environment *) + print (); + (* Replace data in file *) BaseFileAB.replace t.package.files_ab @@ -3551,45 +3672,55 @@ args let doc t args = - BaseDoc.doc - (join_plugin_sections - (function - | Doc (cs, e) -> - Some - (lookup_plugin_section - "documentation" - (s_ "build") - cs.cs_name - t.doc, - cs, - e) - | _ -> - None) - t.package.sections) - t.package - args - - let test t args = - BaseTest.test - (join_plugin_sections - (function - | Test (cs, e) -> - Some - (lookup_plugin_section - "test" - (s_ "run") - cs.cs_name - t.test, - cs, - e) - | _ -> - None) - t.package.sections) - t.package - args + if bool_of_string (BaseStandardVar.docs ()) then + BaseDoc.doc + (join_plugin_sections + (function + | Doc (cs, e) -> + Some + (lookup_plugin_section + "documentation" + (s_ "build") + cs.cs_name + t.doc, + cs, + e) + | _ -> + None) + t.package.sections) + t.package + args + else + BaseMessage.warning + "Docs are turned off, consider enabling with \ + 'ocaml setup.ml -configure --enable-docs'" + + let test t args = + if bool_of_string (BaseStandardVar.tests ()) then + BaseTest.test + (join_plugin_sections + (function + | Test (cs, e) -> + Some + (lookup_plugin_section + "test" + (s_ "run") + cs.cs_name + t.test, + cs, + e) + | _ -> + None) + t.package.sections) + t.package + args + else + BaseMessage.warning + "Tests are turned off, consider enabling with \ + 'ocaml setup.ml -configure --enable-tests'" let all t args = - let rno_doc = + let rno_doc = ref false in let rno_test = @@ -3597,8 +3728,8 @@ in Arg.parse_argv ~current:(ref 0) - (Array.of_list - ((Sys.executable_name^" all") :: + (Array.of_list + ((Sys.executable_name^" all") :: (Array.to_list args))) [ "-no-doc", @@ -3609,18 +3740,18 @@ Arg.Set rno_test, s_ "Don't run test target"; ] - (failwithf1 (f_ "Don't know what to do with '%s'")) + (failwithf (f_ "Don't know what to do with '%s'")) ""; - + info "Running configure step"; configure t [||]; - + info "Running build step"; build t [||]; (* Load setup.log dynamic variables *) BaseDynVar.init t.package; - + if not !rno_doc then begin info "Running doc step"; @@ -3657,19 +3788,19 @@ uninstall t args; install t args - let clean, distclean = + let clean, distclean = let failsafe f a = - try + try f a with e -> - warning + warning (f_ "Action fail with error: %s") - (match e with + (match e with | Failure msg -> msg | e -> Printexc.to_string e) in - let generic_clean t cstm mains docs tests args = + let generic_clean t cstm mains docs tests args = BaseCustom.hook ~failsafe:true cstm @@ -3679,7 +3810,7 @@ (function | Test (cs, test) -> let f = - try + try List.assoc cs.cs_name tests with Not_found -> fun _ _ _ -> () @@ -3690,22 +3821,22 @@ | Doc (cs, doc) -> let f = try - List.assoc cs.cs_name docs + List.assoc cs.cs_name docs with Not_found -> fun _ _ _ -> () in - failsafe + failsafe (f t.package (cs, doc)) args - | Library _ + | Library _ | Executable _ - | Flag _ + | Flag _ | SrcRepo _ -> ()) t.package.sections; (* Clean whole package *) List.iter - (fun f -> + (fun f -> failsafe (f t.package) args) @@ -3714,12 +3845,12 @@ in let clean t args = - generic_clean - t + generic_clean + t t.package.clean_custom - t.clean - t.clean_doc - t.clean_test + t.clean + t.clean_doc + t.clean_test args in @@ -3735,35 +3866,35 @@ info (f_ "Remove '%s'") fn; Sys.remove fn end) - (BaseEnv.default_filename - :: + (BaseEnv.default_filename + :: BaseLog.default_filename :: (List.rev_map BaseFileAB.to_filename t.package.files_ab)); - + (* Call distclean code *) - generic_clean - t + generic_clean + t t.package.distclean_custom - t.distclean - t.distclean_doc - t.distclean_test + t.distclean + t.distclean_doc + t.distclean_test args in clean, distclean - let version t _ = + let version t _ = print_endline t.version - let setup t = + let setup t = let catch_exn = ref true in try let act_ref = - ref (fun _ -> - failwithf2 + ref (fun _ -> + failwithf (f_ "No action defined, run '%s %s -help'") Sys.executable_name Sys.argv.(0)) @@ -3772,7 +3903,7 @@ let extra_args_ref = ref [] in - let allow_empty_env_ref = + let allow_empty_env_ref = ref false in let arg_handle ?(allow_empty_env=false) act = @@ -3780,14 +3911,14 @@ [ Arg.Rest (fun str -> extra_args_ref := str :: !extra_args_ref); - Arg.Unit - (fun () -> + Arg.Unit + (fun () -> allow_empty_env_ref := allow_empty_env; act_ref := act); ] in - Arg.parse + Arg.parse (Arg.align [ "-configure", @@ -3824,7 +3955,7 @@ arg_handle reinstall, s_ "[options*] Uninstall and install libraries, data, \ executables and documents."; - + "-clean", arg_handle ~allow_empty_env:true clean, s_ "[options*] Clean files generated by a build."; @@ -3840,9 +3971,9 @@ "-no-catch-exn", Arg.Clear catch_exn, s_ " Don't catch exception, useful for debugging."; - ] + ] @ (BaseContext.args ())) - (failwithf1 (f_ "Don't know what to do with '%s'")) + (failwithf (f_ "Don't know what to do with '%s'")) (s_ "Setup and run build process current package\n"); (* Build initial environment *) @@ -3851,30 +3982,31 @@ (** Initialize flags *) List.iter (function - | Flag (cs, {flag_description = hlp; + | Flag (cs, {flag_description = hlp; flag_default = choices}) -> begin - let apply ?short_desc () = + let apply ?short_desc () = var_ignore (var_define ~cli:CLIEnable ?short_desc (OASISUtils.varname_of_string cs.cs_name) - (lazy (string_of_bool - (var_choose - ~name:(Printf.sprintf - (f_ "default value of flag %s") - cs.cs_name) - ~printer:string_of_bool - choices)))) + (fun () -> + string_of_bool + (var_choose + ~name:(Printf.sprintf + (f_ "default value of flag %s") + cs.cs_name) + ~printer:string_of_bool + choices))) in - match hlp with + match hlp with | Some hlp -> apply ~short_desc:(fun () -> hlp) () | None -> apply () end - | _ -> + | _ -> ()) t.package.sections; @@ -3885,25 +4017,25 @@ !act_ref t (Array.of_list (List.rev !extra_args_ref)) with e when !catch_exn -> - error "%s" (string_of_exception e); + error "%s" (Printexc.to_string e); exit 1 end module BaseDev = struct -# 21 "/Users/mmottl/Downloads/oasis/src/base/BaseDev.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/base/BaseDev.ml" open OASISGettext open BaseMessage - type t = + type t = { oasis_cmd: string; } - let update_and_run t = + let update_and_run t = (* Command line to run setup-dev *) let oasis_args = "setup-dev" :: "-run" :: @@ -3911,35 +4043,35 @@ (Array.to_list Sys.argv) in - let exit_on_child_error = + let exit_on_child_error = function | 0 -> () | 2 -> (* Bad CLI arguments *) - error + error (f_ "The command '%s %s' exit with code 2. It often means that we \ don't use the right command-line arguments, rerun \ 'oasis setup-dev'.") t.oasis_cmd (String.concat " " oasis_args) - | 127 -> + | 127 -> (* Cannot find OASIS *) - error + error (f_ "Cannot find executable '%s', check where 'oasis' is located \ and rerun 'oasis setup-dev'") t.oasis_cmd - | i -> + | i -> exit i in - let () = + let () = (* Run OASIS to generate a temporary setup.ml *) - BaseExec.run + BaseExec.run ~f_exit_code:exit_on_child_error - t.oasis_cmd + t.oasis_cmd oasis_args in @@ -3949,7 +4081,7 @@ module InternalConfigurePlugin = struct -# 21 "/Users/mmottl/Downloads/oasis/src/plugins/internal/InternalConfigurePlugin.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/plugins/internal/InternalConfigurePlugin.ml" (** Configure using internal scheme @author Sylvain Le Gall @@ -3965,14 +4097,14 @@ * and then output corresponding file. *) let configure pkg argv = - let var_ignore_eval var = + let var_ignore_eval var = let _s : string = var () - in + in () in - let errors = + let errors = ref SetString.empty in @@ -3990,16 +4122,16 @@ in let warn_exception e = - warning "%s" (string_of_exception e) + warning "%s" (Printexc.to_string e) in (* Check tools *) let check_tools lst = - List.iter + List.iter (function - | ExternalTool tool -> + | ExternalTool tool -> begin - try + try var_ignore_eval (BaseCheck.prog tool) with e -> warn_exception e; @@ -4009,8 +4141,8 @@ (* Check that matching tool is built *) List.iter (function - | Executable ({cs_name = nm2}, - {bs_build = build}, + | Executable ({cs_name = nm2}, + {bs_build = build}, _) when nm1 = nm2 -> if not (var_choose build) then add_errors @@ -4028,7 +4160,7 @@ begin if bs.bs_compiled_object = Native then begin - try + try var_ignore_eval BaseStandardVar.ocamlopt with e -> warn_exception e; @@ -4041,11 +4173,11 @@ check_tools bs.bs_build_tools; (* Check depends *) - List.iter + List.iter (function | FindlibPackage (findlib_pkg, version_comparator) -> begin - try + try var_ignore_eval (BaseCheck.package ?version_comparator findlib_pkg) with e -> @@ -4066,7 +4198,7 @@ List.iter (function | Library ({cs_name = nm2}, - {bs_build = build}, + {bs_build = build}, _) when nm1 = nm2 -> if not (var_choose build) then add_errors @@ -4085,18 +4217,18 @@ (* OCaml version *) begin - match pkg.ocaml_version with + match pkg.ocaml_version with | Some ver_cmp -> begin - try + try var_ignore_eval - (BaseCheck.version - "ocaml" - ver_cmp + (BaseCheck.version + "ocaml" + ver_cmp BaseStandardVar.ocaml_version) with e -> warn_exception e; - add_errors + add_errors (f_ "OCaml version %s doesn't match version constraint %s") (BaseStandardVar.ocaml_version ()) (OASISVersion.string_of_comparator ver_cmp) @@ -4104,21 +4236,21 @@ | None -> () end; - + (* Findlib version *) begin - match pkg.findlib_version with + match pkg.findlib_version with | Some ver_cmp -> begin - try + try var_ignore_eval - (BaseCheck.version - "findlib" - ver_cmp + (BaseCheck.version + "findlib" + ver_cmp BaseStandardVar.findlib_version) with e -> warn_exception e; - add_errors + add_errors (f_ "Findlib version %s doesn't match version constraint %s") (BaseStandardVar.findlib_version ()) (OASISVersion.string_of_comparator ver_cmp) @@ -4143,19 +4275,14 @@ ()) pkg.sections; - (* Save and print environment *) - if SetString.empty = !errors then - begin - dump (); - print () - end - else + (* Check errors *) + if SetString.empty != !errors then begin List.iter (fun e -> error "%s" e) (SetString.elements !errors); - failwithf1 - (fn_ + failwithf + (fn_ "%d configuration error" "%d configuration errors" (SetString.cardinal !errors)) @@ -4165,7 +4292,7 @@ end module InternalInstallPlugin = struct -# 21 "/Users/mmottl/Downloads/oasis/src/plugins/internal/InternalInstallPlugin.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/plugins/internal/InternalInstallPlugin.ml" (** Install using internal scheme @author Sylvain Le Gall @@ -4188,7 +4315,7 @@ let doc_hook = ref (fun (cs, doc) -> cs, doc) - let install_file_ev = + let install_file_ev = "install-file" let install_dir_ev = @@ -4200,9 +4327,9 @@ let install pkg argv = let in_destdir = - try + try let destdir = - destdir () + destdir () in (* Practically speaking destdir is prepended * at the beginning of the target filename @@ -4212,17 +4339,21 @@ fun fn -> fn in - let install_file src_file envdir = - let tgt_dir = + let install_file ?tgt_fn src_file envdir = + let tgt_dir = in_destdir (envdir ()) in let tgt_file = - Filename.concat + Filename.concat tgt_dir - (Filename.basename src_file) + (match tgt_fn with + | Some fn -> + fn + | None -> + Filename.basename src_file) in (* Create target directory if needed *) - BaseFileUtil.mkdir_parent + BaseFileUtil.mkdir_parent (fun dn -> info (f_ "Creating directory '%s'") dn; BaseLog.register install_dir_ev dn) @@ -4236,85 +4367,82 @@ (* Install data into defined directory *) let install_data srcdir lst tgtdir = - let tgtdir = + let tgtdir = BaseFilePath.of_unix (var_expand tgtdir) in List.iter (fun (src, tgt_opt) -> - let real_srcs = - BaseFileUtil.glob + let real_srcs = + BaseFileUtil.glob (Filename.concat srcdir src) in if real_srcs = [] then - failwithf1 + failwithf (f_ "Wildcard '%s' doesn't match any files") src; - List.iter - (fun fn -> - install_file - fn - (fun () -> - match tgt_opt with - | Some s -> + List.iter + (fun fn -> + install_file + fn + (fun () -> + match tgt_opt with + | Some s -> BaseFilePath.of_unix (var_expand s) - | None -> + | None -> tgtdir)) real_srcs) lst - in + in (** Install all libraries *) let install_libs pkg = - let files_of_library (f_data, acc) data_lib = + let files_of_library (f_data, acc) data_lib = let cs, bs, lib, lib_extra = !lib_hook data_lib in - if var_choose bs.bs_install && + if var_choose bs.bs_install && BaseBuilt.is_built BaseBuilt.BLib cs.cs_name then begin - let acc = + let acc = (* Start with acc + lib_extra *) List.rev_append lib_extra acc in let acc = - if lib.lib_pack then - acc - else - (* Add uncompiled header from the source tree (for non-packed libraries) *) - let path = - BaseFilePath.of_unix bs.bs_path - in - List.fold_left - (fun acc modul -> - try - List.find - Sys.file_exists - (List.map - (Filename.concat path) - [modul^".mli"; - modul^".ml"; - String.uncapitalize modul^".mli"; - String.capitalize modul^".mli"; - String.uncapitalize modul^".ml"; - String.capitalize modul^".ml"]) - :: acc - with Not_found -> - begin - warning - (f_ "Cannot find source header for module %s \ - in library %s") - modul cs.cs_name; - acc - end) - acc - lib.lib_modules + (* Add uncompiled header from the source tree *) + let path = + BaseFilePath.of_unix bs.bs_path + in + List.fold_left + (fun acc modul -> + try + List.find + Sys.file_exists + (List.map + (Filename.concat path) + [modul^".mli"; + modul^".ml"; + String.uncapitalize modul^".mli"; + String.capitalize modul^".mli"; + String.uncapitalize modul^".ml"; + String.capitalize modul^".ml"]) + :: acc + with Not_found -> + begin + warning + (f_ "Cannot find source header for module %s \ + in library %s") + modul cs.cs_name; + acc + end) + acc + lib.lib_modules in - let acc = + let acc = (* Get generated files *) - BaseBuilt.fold - BaseBuilt.BLib + BaseBuilt.fold + BaseBuilt.BLib cs.cs_name (fun acc fn -> fn :: acc) acc @@ -4325,7 +4453,7 @@ install_data bs.bs_path bs.bs_data_files - (Filename.concat + (Filename.concat (datarootdir ()) pkg.name); f_data () @@ -4340,11 +4468,11 @@ in (* Install one group of library *) - let install_group_lib grp = + let install_group_lib grp = (* Iterate through all group nodes *) let rec install_group_lib_aux data_and_files grp = - let data_and_files, children = - match grp with + let data_and_files, children = + match grp with | Container (_, children) -> data_and_files, children | Package (_, cs, bs, lib, children) -> @@ -4372,7 +4500,7 @@ in (* Really install, if there is something to install *) - if files = [] then + if files = [] then begin warning (f_ "Nothing to install for findlib library '%s'") @@ -4380,28 +4508,56 @@ end else begin - let meta = + let meta = (* Search META file *) - let (_, bs, _) = + let (_, bs, _) = root_lib in - let res = + let res = Filename.concat bs.bs_path "META" in if not (Sys.file_exists res) then - failwithf2 + failwithf (f_ "Cannot find file '%s' for findlib library %s") res findlib_name; res in - info + let files = + (* Make filename shorter to avoid hitting command max line length + * too early, esp. on Windows. + *) + let remove_prefix p n = + let plen = String.length p in + let nlen = String.length n in + if plen <= nlen && String.sub n 0 plen = p then + begin + let fn_sep = + if Sys.os_type = "Win32" then + '\\' + else + '/' + in + let cutpoint = plen + + (if plen < nlen && n.[plen] = fn_sep then + 1 + else + 0) + in + String.sub n cutpoint (nlen - cutpoint) + end + else + n + in + List.map (remove_prefix (Sys.getcwd ())) files + in + info (f_ "Installing findlib library '%s'") findlib_name; - BaseExec.run - (ocamlfind ()) + BaseExec.run + (ocamlfind ()) ("install" :: findlib_name :: meta :: files); - BaseLog.register install_findlib_ev findlib_name + BaseLog.register install_findlib_ev findlib_name end; (* Install data files *) @@ -4410,12 +4566,12 @@ in (* We install libraries in groups *) - List.iter + List.iter install_group_lib (group_libs pkg) in - let install_execs pkg = + let install_execs pkg = let install_exec data_exec = let (cs, bs, exec) = !exec_hook data_exec @@ -4424,7 +4580,7 @@ BaseBuilt.is_built BaseBuilt.BExec cs.cs_name then begin let exec_libdir () = - Filename.concat + Filename.concat (libdir ()) pkg.name in @@ -4433,6 +4589,7 @@ cs.cs_name (fun () fn -> install_file + ~tgt_fn:cs.cs_name fn bindir) (); @@ -4447,7 +4604,7 @@ install_data bs.bs_path bs.bs_data_files - (Filename.concat + (Filename.concat (datarootdir ()) pkg.name) end @@ -4461,7 +4618,7 @@ pkg.sections in - let install_docs pkg = + let install_docs pkg = let install_doc data = let (cs, doc) = !doc_hook data @@ -4476,8 +4633,8 @@ BaseBuilt.BDoc cs.cs_name (fun () fn -> - install_file - fn + install_file + fn (fun () -> tgt_dir)) (); install_data @@ -4494,14 +4651,14 @@ ()) pkg.sections in - + install_libs pkg; install_execs pkg; install_docs pkg (* Uninstall already installed data *) let uninstall _ argv = - List.iter + List.iter (fun (ev, data) -> if ev = install_file_ev then begin @@ -4518,7 +4675,7 @@ (f_ "File '%s' doesn't exist anymore") data end - end + end else if ev = install_dir_ev then begin if Sys.file_exists data && Sys.is_directory data then @@ -4532,16 +4689,16 @@ end else begin - warning + warning (f_ "Directory '%s' is not empty (%s)") data - (String.concat - ", " - (Array.to_list + (String.concat + ", " + (Array.to_list (Sys.readdir data))) end end - else + else begin warning (f_ "Directory '%s' doesn't exist anymore") @@ -4554,12 +4711,12 @@ BaseExec.run (ocamlfind ()) ["remove"; data] end else - failwithf1 (f_ "Unknown log event '%s'") ev; + failwithf (f_ "Unknown log event '%s'") ev; BaseLog.unregister ev data) (* We process event in reverse order *) - (List.rev - (BaseLog.filter - [install_file_ev; + (List.rev + (BaseLog.filter + [install_file_ev; install_dir_ev; install_findlib_ev;])) @@ -4567,7 +4724,7 @@ module OCamlbuildCommon = struct -# 21 "/Users/mmottl/Downloads/oasis/src/plugins/ocamlbuild/OCamlbuildCommon.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/plugins/ocamlbuild/OCamlbuildCommon.ml" (** Functions common to OCamlbuild build and doc plugin *) @@ -4583,7 +4740,7 @@ var_define ~short_desc:(fun () -> "OCamlbuild additional flags") "ocamlbuildflags" - (lazy "") + (fun () -> "") (** Fix special arguments depending on environment *) let fix_args args extra_argv = @@ -4591,18 +4748,18 @@ [ if (os_type ()) = "Win32" then [ - "-classic-display"; - "-no-log"; + "-classic-display"; + "-no-log"; "-no-links"; - "-install-lib-dir"; + "-install-lib-dir"; (Filename.concat (standard_library ()) "ocamlbuild") - ] + ] else []; - + if not (bool_of_string (is_native ())) || (os_type ()) = "Win32" then [ - "-byte-plugin" + "-byte-plugin" ] else []; @@ -4633,9 +4790,9 @@ begin BaseExec.run (ocamlbuild ()) (fix_args ["-clean"] extra_argv); BaseLog.register ocamlbuild_clean_ev extra_cli; - at_exit + at_exit (fun () -> - try + try BaseLog.unregister ocamlbuild_clean_ev extra_cli with _ -> ()) @@ -4659,7 +4816,7 @@ search_args dir tl | _ :: tl -> search_args dir tl - | [] -> + | [] -> dir in search_args "_build" (fix_args [] extra_argv) @@ -4667,9 +4824,9 @@ end module OCamlbuildPlugin = struct -# 21 "/Users/mmottl/Downloads/oasis/src/plugins/ocamlbuild/OCamlbuildPlugin.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/plugins/ocamlbuild/OCamlbuildPlugin.ml" - (** Build using ocamlbuild + (** Build using ocamlbuild @author Sylvain Le Gall *) @@ -4681,10 +4838,6 @@ open BaseStandardVar open BaseMessage - type target = - | Std of string list - | StdRename of string * string - let cond_targets_hook = ref (fun lst -> lst) @@ -4692,8 +4845,8 @@ (* Return the filename in build directory *) let in_build_dir fn = - Filename.concat - (build_dir argv) + Filename.concat + (build_dir argv) fn in @@ -4705,11 +4858,11 @@ let cond_targets = List.fold_left (fun acc -> - function + function | Library (cs, bs, lib) when var_choose bs.bs_build -> begin let evs, unix_files = - BaseBuilt.of_library + BaseBuilt.of_library in_build_dir_of_unix (cs, bs, lib) in @@ -4720,65 +4873,61 @@ in (String.length fn >= nd_len) && - (String.sub + (String.sub fn (String.length fn - nd_len) nd_len) = nd in let tgts = - List.filter - (fun l -> l <> []) - (List.map - (List.filter - (fun fn -> - ends_with ".cma" fn || - ends_with ".cmxa" fn || - ends_with (ext_lib ()) fn || - ends_with (ext_dll ()) fn)) - unix_files) + List.flatten + (List.filter + (fun l -> l <> []) + (List.map + (List.filter + (fun fn -> + ends_with ".cma" fn || + ends_with ".cmxa" fn || + ends_with (ext_lib ()) fn || + ends_with (ext_dll ()) fn)) + unix_files)) in - match tgts with - | hd :: tl -> - (evs, Std hd) - :: - (List.map (fun tgts -> [], Std tgts) tl) - @ - acc + match tgts with + | _ :: _ -> + (evs, tgts) :: acc | [] -> - failwithf2 - (f_ "No possible ocamlbuild targets \ - in generated files %s for library %s") - (String.concat (s_ ", " ) (List.map (String.concat (s_ ", ")) tgts)) + failwithf + (f_ "No possible ocamlbuild targets for library %s") cs.cs_name end | Executable (cs, bs, exec) when var_choose bs.bs_build -> begin let evs, unix_exec_is, unix_dll_opt = - BaseBuilt.of_executable + BaseBuilt.of_executable in_build_dir_of_unix (cs, bs, exec) in - let host_exec_is = - in_build_dir_of_unix unix_exec_is - in - let target ext = - let unix_tgt = + let unix_tgt = (BaseFilePath.Unix.concat bs.bs_path - (BaseFilePath.Unix.chop_extension + (BaseFilePath.Unix.chop_extension exec.exec_main_is))^ext in - - evs, - (if unix_tgt = unix_exec_is then - Std [unix_tgt] - else - StdRename (unix_tgt, host_exec_is)) + let evs = + (* Fix evs, we want to use the unix_tgt, without copying *) + List.map + (function + | BaseBuilt.BExec, nm, lst when nm = cs.cs_name -> + BaseBuilt.BExec, nm, [[in_build_dir_of_unix unix_tgt]] + | ev -> + ev) + evs + in + evs, [unix_tgt] in (* Add executable *) @@ -4795,7 +4944,7 @@ acc end - | Library _ | Executable _ | Test _ + | Library _ | Executable _ | Test _ | SrcRepo _ | Flag _ | Doc _ -> acc) [] @@ -4804,97 +4953,34 @@ in (* Check and register built files *) - let check_and_register (bt, bnm, lst) = + let check_and_register (bt, bnm, lst) = List.iter (fun fns -> if not (List.exists Sys.file_exists fns) then - failwithf1 + failwithf (f_ "No one of expected built files %s exists") (String.concat (s_ ", ") (List.map (Printf.sprintf "'%s'") fns))) lst; - (BaseBuilt.register bt bnm lst) + (BaseBuilt.register bt bnm lst) + in + + let cond_targets = + (* Run the hook *) + !cond_targets_hook cond_targets in - (* Run a list of target + post process *) - let run_ocamlbuild rtargets = + (* Run a list of target... *) run_ocamlbuild - (List.rev_map snd rtargets) + (List.flatten + (List.map snd cond_targets)) argv; + (* ... and register events *) List.iter check_and_register - (List.flatten (List.rev_map fst rtargets)) - in - - (* Compare two files, return true if they differ *) - let diff fn1 fn2 = - if Sys.file_exists fn1 && Sys.file_exists fn2 then - begin - let chn1 = open_in fn1 in - let chn2 = open_in fn2 in - let res = - if in_channel_length chn1 = in_channel_length chn2 then - begin - let len = - 4096 - in - let str1 = - String.make len '\000' - in - let str2 = - String.copy str1 - in - try - while (String.compare str1 str2) = 0 do - really_input chn1 str1 0 len; - really_input chn2 str2 0 len - done; - true - with End_of_file -> - false - end - else - true - in - close_in chn1; close_in chn2; - res - end - else - true - in + (List.flatten (List.map fst cond_targets)) - let last_rtargets = - List.fold_left - (fun acc (built, tgt) -> - match tgt with - | Std nms -> - (built, List.hd nms) :: acc - | StdRename (src, tgt) -> - begin - (* We run with a fake list for event registering *) - run_ocamlbuild (([], src) :: acc); - - (* And then copy and register *) - begin - let src_fn = - in_build_dir_of_unix src - in - if diff src_fn tgt then - BaseFileUtil.cp src_fn tgt - else - info - (f_ "No need to copy file '%s' to '%s', same content") - src_fn tgt - end; - List.iter check_and_register built; - [] - end) - [] - (!cond_targets_hook cond_targets) - in - if last_rtargets <> [] then - run_ocamlbuild last_rtargets - let clean pkg extra_args = + let clean pkg extra_args = run_clean extra_args; List.iter (function @@ -4910,7 +4996,7 @@ end module OCamlbuildDocPlugin = struct -# 21 "/Users/mmottl/Downloads/oasis/src/plugins/ocamlbuild/OCamlbuildDocPlugin.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/plugins/ocamlbuild/OCamlbuildDocPlugin.ml" (* Create documentation using ocamlbuild .odocl files @author Sylvain Le Gall @@ -4947,7 +5033,7 @@ BaseBuilt.register BaseBuilt.BDoc cs.cs_name - [BaseFileUtil.glob + [BaseFileUtil.glob (Filename.concat tgt_dir glb)]) ["*.html"; "*.css"] @@ -4959,7 +5045,7 @@ module CustomPlugin = struct -# 21 "/Users/mmottl/Downloads/oasis/src/plugins/custom/CustomPlugin.ml" +# 21 "/Users/mmottl/Downloads/oasis-0.3.0~rc2/src/plugins/custom/CustomPlugin.ml" (** Generate custom configure/build/doc/test/install system @author @@ -5121,7 +5207,7 @@ cmd_distclean = [(OASISExpr.EBool true, None)]; }) ]; - doc = []; + doc = [("sexplib", OCamlbuildDocPlugin.doc_build "lib")]; install = InternalInstallPlugin.install; uninstall = InternalInstallPlugin.uninstall; clean = [OCamlbuildPlugin.clean]; @@ -5147,7 +5233,7 @@ cmd_distclean = [(OASISExpr.EBool true, None)]; }) ]; - clean_doc = []; + clean_doc = [("sexplib", OCamlbuildDocPlugin.doc_clean "lib")]; distclean = []; distclean_test = [ @@ -5174,11 +5260,11 @@ distclean_doc = []; package = { - oasis_version = "0.2"; + oasis_version = "0.3"; ocaml_version = Some (OASISVersion.VGreaterEqual "3.12"); findlib_version = None; name = "sexplib"; - version = "7.0.4"; + version = "7.0.5"; license = OASISLicense.DEP5License { @@ -5194,19 +5280,19 @@ synopsis = "automated S-expression conversion"; description = None; categories = []; - conf_type = (`Configure, "internal", Some "0.2"); + conf_type = (`Configure, "internal", Some "0.3"); conf_custom = { pre_command = [(OASISExpr.EBool true, None)]; post_command = [(OASISExpr.EBool true, None)]; }; - build_type = (`Build, "ocamlbuild", Some "0.2"); + build_type = (`Build, "ocamlbuild", Some "0.3"); build_custom = { pre_command = [(OASISExpr.EBool true, None)]; post_command = [(OASISExpr.EBool true, None)]; }; - install_type = (`Install, "internal", Some "0.2"); + install_type = (`Install, "internal", Some "0.3"); install_custom = { pre_command = [(OASISExpr.EBool true, None)]; @@ -5247,7 +5333,8 @@ FindlibPackage ("bigarray", None); FindlibPackage ("num", None) ]; - bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_build_tools = + [ExternalTool "ocamlbuild"; ExternalTool "camlp4o"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; @@ -5275,7 +5362,7 @@ lib_pack = true; lib_internal_modules = []; lib_findlib_parent = None; - lib_findlib_name = Some "sexplib"; + lib_findlib_name = None; lib_findlib_containers = []; }); Library @@ -5294,10 +5381,11 @@ FindlibPackage ("camlp4.quotations", None); FindlibPackage ("camlp4.extend", None); FindlibPackage - ("type-conv", - Some (OASISVersion.VGreaterEqual "3.0.4")) + ("type_conv", + Some (OASISVersion.VGreaterEqual "3.0.5")) ]; - bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_build_tools = + [ExternalTool "ocamlbuild"; ExternalTool "camlp4o"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; @@ -5335,7 +5423,8 @@ InternalLibrary "sexplib"; InternalLibrary "pa_sexp_conv" ]; - bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_build_tools = + [ExternalTool "ocamlbuild"; ExternalTool "camlp4o"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; @@ -5358,7 +5447,8 @@ bs_path = "top"; bs_compiled_object = Best; bs_build_depends = []; - bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_build_tools = + [ExternalTool "ocamlbuild"; ExternalTool "camlp4o"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; @@ -5383,7 +5473,7 @@ cs_plugin_data = []; }, { - test_type = (`Test, "custom", Some "0.2"); + test_type = (`Test, "custom", Some "0.3"); test_command = [ (OASISExpr.EBool true, @@ -5400,17 +5490,8 @@ (OASISExpr.EBool true, false); (OASISExpr.EFlag "tests", true) ]; - test_tools = [ExternalTool "ocamlbuild"]; - }); - Flag - ({ - cs_name = "tests"; - cs_data = PropList.Data.create (); - cs_plugin_data = []; - }, - { - flag_description = Some "Build and run tests"; - flag_default = [(OASISExpr.EBool true, true)]; + test_tools = + [ExternalTool "ocamlbuild"; ExternalTool "camlp4o"]; }); Test ({ @@ -5419,7 +5500,7 @@ cs_plugin_data = []; }, { - test_type = (`Test, "custom", Some "0.2"); + test_type = (`Test, "custom", Some "0.3"); test_command = [(OASISExpr.EBool true, ("$conv_test", []))]; test_custom = @@ -5433,7 +5514,8 @@ (OASISExpr.EBool true, false); (OASISExpr.EFlag "tests", true) ]; - test_tools = [ExternalTool "ocamlbuild"]; + test_tools = + [ExternalTool "ocamlbuild"; ExternalTool "camlp4o"]; }); Executable ({ @@ -5451,7 +5533,8 @@ bs_path = "lib_test"; bs_compiled_object = Byte; bs_build_depends = [InternalLibrary "sexplib"]; - bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_build_tools = + [ExternalTool "ocamlbuild"; ExternalTool "camlp4o"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; @@ -5461,21 +5544,54 @@ bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, - {exec_custom = false; exec_main_is = "sexp_test.ml"; }) + {exec_custom = false; exec_main_is = "sexp_test.ml"; }); + Doc + ({ + cs_name = "sexplib"; + cs_data = PropList.Data.create (); + cs_plugin_data = []; + }, + { + doc_type = (`Doc, "ocamlbuild", Some "0.3"); + doc_custom = + { + pre_command = [(OASISExpr.EBool true, None)]; + post_command = [(OASISExpr.EBool true, None)]; + }; + doc_build = + [ + (OASISExpr.EBool true, false); + (OASISExpr.EFlag "docs", true) + ]; + doc_install = [(OASISExpr.EBool true, true)]; + doc_install_dir = "$docdir"; + doc_title = "API reference for sexplib"; + doc_authors = []; + doc_abstract = None; + doc_format = OtherDoc; + doc_data_files = []; + doc_build_tools = + [ + ExternalTool "ocamlbuild"; + ExternalTool "camlp4o"; + ExternalTool "ocamldoc" + ]; + }) ]; plugins = [ - (`Extra, "StdFiles", Some "0.2"); - (`Extra, "DevFiles", Some "0.2"); - (`Extra, "META", Some "0.2") + (`Extra, "StdFiles", Some "0.3"); + (`Extra, "DevFiles", Some "0.3"); + (`Extra, "META", Some "0.3") ]; schema_data = PropList.Data.create (); plugin_data = []; }; - version = "0.2.0"; + version = "0.3.0~rc2"; };; let setup () = BaseSetup.setup setup_t;; +# 5596 "setup.ml" (* OASIS_STOP *) let () = setup ();;