This is an automated email from the git hooks/post-receive script.

glondu pushed a commit to branch master
in repository oasis.

commit 166a1972d50e7d34350b7b04cca81c62a87c4f3b
Author: Stephane Glondu <st...@glondu.net>
Date:   Wed Mar 26 07:19:17 2014 +0100

    Imported Upstream version 0.4.4
---
 AUTHORS.txt                                        |  14 +-
 CHANGES.txt                                        |  10 +
 INSTALL.txt                                        |   4 +-
 Makefile                                           |  13 +-
 README.txt                                         |  29 ++-
 _oasis                                             |   2 +-
 myocamlbuild.ml                                    |  47 ++--
 setup.ml                                           | 257 +++++++++++++++------
 src/ext/plugin-loader/src/META                     |   4 +-
 .../plugin-loader/test/data/findlib/plugin1/META   |   4 +-
 .../plugin-loader/test/data/findlib/plugin2/META   |   4 +-
 .../plugin-loader/test/data/findlib/plugin3/META   |   4 +-
 .../test/data/findlib/pluginloaderLib/META         |   4 +-
 src/ext/userconf/src/META                          |   4 +-
 src/oasis/META                                     |  12 +-
 src/oasis/OASISFileTemplate.ml                     |  80 +++----
 test/TestFileTemplate.ml                           |  35 ++-
 17 files changed, 348 insertions(+), 179 deletions(-)

diff --git a/AUTHORS.txt b/AUTHORS.txt
index 6bc0b47..2193618 100644
--- a/AUTHORS.txt
+++ b/AUTHORS.txt
@@ -1,8 +1,12 @@
 (* OASIS_START *)
-(* DO NOT EDIT (digest: 3c4eedb3b1918f0abe7af95ae3ea5c77) *)
-Authors of oasis
-Sylvain Le Gall
+(* DO NOT EDIT (digest: 42d3c82e95c25b7f485d1a22832dc8cd) *)
+
+Authors of oasis:
+
+* Sylvain Le Gall
+
+Current maintainers of oasis:
+
+* Sylvain Le Gall <gil...@ocamlcore.org>
 
-Current maintainers of oasis
-Sylvain Le Gall <gil...@ocamlcore.org>
 (* OASIS_STOP *)
diff --git a/CHANGES.txt b/CHANGES.txt
index be4f2ec..ddd89cc 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,13 @@
+2014-03-26  Sylvain Le Gall <sylvain AT le-gall.net>
+
+  * Version 0.4.3
+
+  * Quick bug fix release:
+
+    * Don't skip some "\n\n" in Makefile/META/myocamlbuild.ml/setup.ml. This
+      bug makes `oasis setup` think that these files have changed even if they
+      have just been regenerated. (Closes: #1382).
+
 2014-03-25  Sylvain Le Gall <sylvain AT le-gall.net>
 
   * Version 0.4.3
diff --git a/INSTALL.txt b/INSTALL.txt
index 1524fa4..f81d1a0 100644
--- a/INSTALL.txt
+++ b/INSTALL.txt
@@ -1,5 +1,6 @@
 (* OASIS_START *)
-(* DO NOT EDIT (digest: 7bdb10b5fab2a15f1b5a1ff4c3905277) *)
+(* DO NOT EDIT (digest: 2e5179ceaf2e2997ce42df0cf788e588) *)
+
 This is the INSTALL file for the oasis distribution.
 
 This package uses OASIS to generate its build system. See section OASIS for
@@ -9,6 +10,7 @@ Dependencies
 ============
 
 In order to compile this package, you will need:
+
 * ocaml (>= 3.11.2) for all, test main, test main_loader, test main_userconf,
   doc api-oasis, doc manual
 * findlib (>= 1.3.1)
diff --git a/Makefile b/Makefile
index 24653f5..7701f10 100644
--- a/Makefile
+++ b/Makefile
@@ -27,12 +27,12 @@ CONFIGUREFLAGS += --override ocamlbuildflags 
-classic-display --enable-tests
 
 default: test
 
-#TESTFLAGS=-only-test "OASIS:16:OASISText" -only-test "OASIS:17:OASISString"
+#TESTFLAGS=-only-test "OASIS:3:FileTemplate:6:META.cohttp"
 TIMINGS=1
 #export TIMINGS
 
 # OASIS_START
-# DO NOT EDIT (digest: 7b2408909643717852b95f994b273fee)
+# DO NOT EDIT (digest: a3c674b4239234cbbe53afe090018954)
 
 SETUP = ocaml setup.ml
 
@@ -66,6 +66,9 @@ distclean:
 setup.data:
        $(SETUP) -configure $(CONFIGUREFLAGS)
 
+configure:
+       $(SETUP) -configure $(CONFIGUREFLAGS)
+
 .PHONY: build doc test all install uninstall reinstall clean distclean 
configure
 
 # OASIS_STOP
@@ -141,7 +144,11 @@ deploy: headache doc-dist
          --forge_extra_file "dist/oasis-doc-$(shell oasis query 
version).tar.gz"
        # TODO: create a plugin to send announcement.
        # oasis announce
-       admin-gallu-oasis-increment --setup_run --use_vcs
+       admin-gallu-oasis-increment --setup_run
+       $(MAKE) distclean
+       ./configure --enable-tests --enable-docs
+       $(MAKE) test
+       git commit -am "Update OASIS version."
 
 .PHONY: deploy
 
diff --git a/README.txt b/README.txt
index cb9c257..87b6d94 100644
--- a/README.txt
+++ b/README.txt
@@ -1,10 +1,8 @@
 (* OASIS_START *)
-(* DO NOT EDIT (digest: 2b4a5449e7c77c51fe4df5736bd5f1c8) *)
-This is the README file for the oasis distribution.
+(* DO NOT EDIT (digest: 850a4f92bc8d28b3dd7640aaec5892a2) *)
 
-(C) 2008-2010 OCamlCore SARL
-
-Architecture for building OCaml libraries and applications
+oasis - Architecture for building OCaml libraries and applications
+==================================================================
 
 OASIS generates a full configure, build and install system for your
 application. It starts with a simple `_oasis` file at the toplevel of your
@@ -14,8 +12,10 @@ It uses external tools like OCamlbuild and it can be 
considered as the glue
 between various subsystems that do the job. It should support the following
 tools:
 
- * OCamlbuild  * OMake (todo)  * OCamlMakefile (todo),  * ocaml-autoconf
-(todo)
+ * OCamlbuild
+ * OMake (todo)
+ * OCamlMakefile (todo),
+ * ocaml-autoconf (todo)
 
 It also features a do-it-yourself command line invocation and an internal
 configure/install scheme. Libraries are managed through findlib. It has been
@@ -24,10 +24,19 @@ tested on GNU Linux and Windows.
 It also allows to have standard entry points and description. It helps to
 integrates your libraries and software with third parties tools like GODI.
 
-See the files INSTALL.txt for building and installation instructions. See the
-file COPYING.txt for copying conditions. 
+See the file [INSTALL.txt](INSTALL.txt) for building and installation
+instructions.
+
+[Home page](http://oasis.forge.ocamlcore.org/)
+
+Copyright and license
+---------------------
+
+(C) 2008-2010 OCamlCore SARL
 
-Home page: http://oasis.forge.ocamlcore.org/
+oasis is distributed under the terms of the GNU Lesser General Public License
+version 2.1 with OCaml linking exception.
 
+See [COPYING.txt](COPYING.txt) for more information.
 
 (* OASIS_STOP *)
diff --git a/_oasis b/_oasis
index a1b490d..32f3d03 100644
--- a/_oasis
+++ b/_oasis
@@ -2,7 +2,7 @@ OASISFormat:  0.3
 OCamlVersion: >= 3.11.2
 FindlibVersion: >= 1.3.1
 Name:         oasis
-Version: 0.4.3
+Version: 0.4.4
 LicenseFile:  COPYING.txt
 License:      LGPL-2.1 with OCaml linking exception
 BuildType:    ocamlbuild (0.3)
diff --git a/myocamlbuild.ml b/myocamlbuild.ml
index 8ea3eaf..1cf83ca 100644
--- a/myocamlbuild.ml
+++ b/myocamlbuild.ml
@@ -114,7 +114,7 @@ rule "ocamlify: %.mlify & %.mlify.depends -> %.ml"
 ;;
 
 (* OASIS_START *)
-(* DO NOT EDIT (digest: e3fbeda1ecad3e58c53bace95431f4c5) *)
+(* DO NOT EDIT (digest: ce83d18189da28a701b37098bb40e572) *)
 module OASISGettext = struct
 # 22 "src/oasis/OASISGettext.ml"
 
@@ -374,6 +374,31 @@ module MyOCamlbuildFindlib = struct
     Ocamlbuild_pack.Lexers.blank_sep_strings
 
 
+  let exec_from_conf exec =
+    let exec =
+      let env_filename = Pathname.basename BaseEnvLight.default_filename in
+      let env = BaseEnvLight.load ~filename:env_filename ~allow_empty:true () 
in
+      try
+        BaseEnvLight.var_get exec env
+      with Not_found ->
+        Printf.eprintf "W: Cannot get variable %s\n" exec;
+        exec
+    in
+    let fix_win32 str =
+      if Sys.os_type = "Win32" then begin
+        let buff = Buffer.create (String.length str) in
+        (* Adapt for windowsi, ocamlbuild + win32 has a hard time to handle 
'\\'.
+         *)
+        String.iter
+          (fun c -> Buffer.add_char buff (if c = '\\' then '/' else c))
+          str;
+        Buffer.contents buff
+      end else begin
+        str
+      end
+    in
+      fix_win32 exec
+
   let split s ch =
     let buf = Buffer.create 13 in
     let x = ref [] in
@@ -401,17 +426,7 @@ module MyOCamlbuildFindlib = struct
     with Not_found -> s
 
   (* ocamlfind command *)
-  let ocamlfind x =
-    let ocamlfind_prog =
-      let env_filename = Pathname.basename BaseEnvLight.default_filename in
-      let env = BaseEnvLight.load ~filename:env_filename ~allow_empty:true () 
in
-      try
-        BaseEnvLight.var_get "ocamlfind" env
-      with Not_found ->
-        Printf.eprintf "W: Cannot get variable ocamlfind";
-        "ocamlfind"
-    in
-      S[Sh ocamlfind_prog; x]
+  let ocamlfind x = S[Sh (exec_from_conf "ocamlfind"); x]
 
   (* This lists all supported packages. *)
   let find_packages () =
@@ -440,7 +455,7 @@ module MyOCamlbuildFindlib = struct
 
   let dispatch =
     function
-      | Before_options ->
+      | After_options ->
           (* By using Before_options one let command line options have an 
higher
            * priority on the contrary using After_options will guarantee to 
have
            * the higher priority override default commands by ocamlfind ones *)
@@ -591,7 +606,7 @@ module MyOCamlbuildBase = struct
                    try
                      opt := no_trailing_dot (BaseEnvLight.var_get var env)
                    with Not_found ->
-                     Printf.eprintf "W: Cannot get variable %s" var)
+                     Printf.eprintf "W: Cannot get variable %s\n" var)
                 [
                   Options.ext_obj, "ext_obj";
                   Options.ext_lib, "ext_lib";
@@ -691,7 +706,7 @@ module MyOCamlbuildBase = struct
 end
 
 
-# 579 "myocamlbuild.ml"
+# 594 "myocamlbuild.ml"
 open Ocamlbuild_plugin;;
 let package_default =
   {
@@ -890,7 +905,7 @@ let package_default =
 
 let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;;
 
-# 779 "myocamlbuild.ml"
+# 794 "myocamlbuild.ml"
 (* OASIS_STOP *)
 
 open Ocamlbuild_plugin;;
diff --git a/setup.ml b/setup.ml
index 8a346c0..7b9f1db 100644
--- a/setup.ml
+++ b/setup.ml
@@ -21,9 +21,9 @@
 
(******************************************************************************)
 
 (* OASIS_START *)
-(* DO NOT EDIT (digest: 1457787566b56b2dae74878f3be4eba1) *)
+(* DO NOT EDIT (digest: d37d9e8764ad8cba0464fcefdb061a34) *)
 (*
-   Regenerated by OASIS v0.4.2
+   Regenerated by OASIS v0.4.3
    Visit http://oasis.forge.ocamlcore.org for more information and
    documentation about functions used in this file.
 *)
@@ -278,29 +278,62 @@ module OASISUtils = struct
   open OASISGettext
 
 
-  module MapString = Map.Make(String)
+  module MapExt =
+  struct
+    module type S =
+    sig
+      include Map.S
+      val add_list: 'a t -> (key * 'a) list -> 'a t
+      val of_list: (key * 'a) list -> 'a t
+      val to_list: 'a t -> (key * 'a) list
+    end
+
+    module Make (Ord: Map.OrderedType) =
+    struct
+      include Map.Make(Ord)
+
+      let rec add_list t =
+        function
+          | (k, v) :: tl -> add_list (add k v t) tl
+          | [] -> t
 
+      let of_list lst = add_list empty lst
 
-  let map_string_of_assoc assoc =
-    List.fold_left
-      (fun acc (k, v) -> MapString.add k v acc)
-      MapString.empty
-      assoc
+      let to_list t = fold (fun k v acc -> (k, v) :: acc) t []
+    end
+  end
 
 
-  module SetString = Set.Make(String)
+  module MapString = MapExt.Make(String)
 
 
-  let set_string_add_list st lst =
-    List.fold_left
-      (fun acc e -> SetString.add e acc)
-      st
-      lst
+  module SetExt  =
+  struct
+    module type S =
+    sig
+      include Set.S
+      val add_list: t -> elt list -> t
+      val of_list: elt list -> t
+      val to_list: t -> elt list
+    end
+
+    module Make (Ord: Set.OrderedType) =
+    struct
+      include Set.Make(Ord)
+
+      let rec add_list t =
+        function
+          | e :: tl -> add_list (add e t) tl
+          | [] -> t
+
+      let of_list lst = add_list empty lst
+
+      let to_list = elements
+    end
+  end
 
 
-  let set_string_of_list =
-    set_string_add_list
-      SetString.empty
+  module SetString = SetExt.Make(String)
 
 
   let compare_csl s1 s2 =
@@ -320,7 +353,7 @@ module OASISUtils = struct
        end)
 
   module SetStringCsl =
-    Set.Make
+    SetExt.Make
       (struct
          type t = string
          let compare = compare_csl
@@ -1067,6 +1100,21 @@ module OASISExpr = struct
 
 end
 
+module OASISText = struct
+# 22 "src/oasis/OASISText.ml"
+
+
+
+  type elt =
+    | Para of string
+    | Verbatim of string
+    | BlankLine
+
+
+  type t = elt list
+
+end
+
 module OASISTypes = struct
 # 22 "src/oasis/OASISTypes.ml"
 
@@ -1299,41 +1347,42 @@ module OASISTypes = struct
 
   type package =
       {
-        oasis_version:    OASISVersion.t;
-        ocaml_version:    OASISVersion.comparator option;
-        findlib_version:  OASISVersion.comparator option;
-        alpha_features:   string list;
-        beta_features:    string list;
-        name:             package_name;
-        version:          OASISVersion.t;
-        license:          OASISLicense.t;
-        license_file:     unix_filename option;
-        copyrights:       string list;
-        maintainers:      string list;
-        authors:          string list;
-        homepage:         url option;
-        synopsis:         string;
-        description:      string option;
-        categories:       url list;
-
-        conf_type:        [`Configure] plugin;
-        conf_custom:      custom;
-
-        build_type:       [`Build] plugin;
-        build_custom:     custom;
-
-        install_type:     [`Install] plugin;
-        install_custom:   custom;
-        uninstall_custom: custom;
-
-        clean_custom:     custom;
-        distclean_custom: custom;
-
-        files_ab:         unix_filename list;
-        sections:         section list;
-        plugins:          [`Extra] plugin list;
-        schema_data:      PropList.Data.t;
-        plugin_data:      plugin_data;
+        oasis_version:          OASISVersion.t;
+        ocaml_version:          OASISVersion.comparator option;
+        findlib_version:        OASISVersion.comparator option;
+        alpha_features:         string list;
+        beta_features:          string list;
+        name:                   package_name;
+        version:                OASISVersion.t;
+        license:                OASISLicense.t;
+        license_file:           unix_filename option;
+        copyrights:             string list;
+        maintainers:            string list;
+        authors:                string list;
+        homepage:               url option;
+        synopsis:               string;
+        description:            OASISText.t option;
+        categories:             url list;
+
+        conf_type:              [`Configure] plugin;
+        conf_custom:            custom;
+
+        build_type:             [`Build] plugin;
+        build_custom:           custom;
+
+        install_type:           [`Install] plugin;
+        install_custom:         custom;
+        uninstall_custom:       custom;
+
+        clean_custom:           custom;
+        distclean_custom:       custom;
+
+        files_ab:               unix_filename list;
+        sections:               section list;
+        plugins:                [`Extra] plugin list;
+        disable_oasis_section:  unix_filename list;
+        schema_data:            PropList.Data.t;
+        plugin_data:            plugin_data;
       }
 
 
@@ -1387,6 +1436,24 @@ module OASISFeatures = struct
 
     let plugin_version plugin_kind plugin_name t =
       MapPlugin.find (plugin_kind, plugin_name) t.plugin_versions
+
+    let to_string t =
+      Printf.sprintf
+        "oasis_version: %s; alpha_features: %s; beta_features: %s; \
+         plugins_version: %s"
+        (OASISVersion.string_of_version t.oasis_version)
+        (String.concat ", " t.alpha_features)
+        (String.concat ", " t.beta_features)
+        (String.concat ", "
+           (MapPlugin.fold
+              (fun (_, plg) ver_opt acc ->
+                 (plg^
+                  (match ver_opt with
+                     | Some v ->
+                         " "^(OASISVersion.string_of_version v)
+                     | None -> ""))
+                 :: acc)
+              t.plugin_versions []))
   end
 
   type origin =
@@ -1427,6 +1494,17 @@ module OASISFeatures = struct
   let beta = InDev Beta
 
 
+  let to_string t =
+    Printf.sprintf
+      "feature: %s; plugin: %s; publication: %s"
+      t.name
+      (match t.plugin with
+         | None -> "<none>"
+         | Some (_, nm, _) -> nm)
+      (match t.publication with
+         | InDev stage -> string_of_stage stage
+         | SinceVersion ver -> ">= "^(OASISVersion.string_of_version ver))
+
   let data_check t data origin =
     let no_message = "no message" in
 
@@ -1659,6 +1737,18 @@ module OASISFeatures = struct
     create "dynrun_for_release" alpha
       (fun () ->
          s_ "Make '-setup-update dynamic' suitable for releasing project.")
+
+
+  let compiled_setup_ml =
+    create "compiled_setup_ml" alpha
+      (fun () ->
+         s_ "It compiles the setup.ml and speed-up actions done with it.")
+
+  let disable_oasis_section =
+    create "disable_oasis_section" alpha
+      (fun () ->
+        s_ "Allows the OASIS section comments and digest to be omitted in \
+            generated files.")
 end
 
 module OASISUnixPath = struct
@@ -2747,14 +2837,17 @@ module OASISFileUtil = struct
 
 
   let rmdir ~ctxt tgt =
-    if Sys.readdir tgt = [||] then
-      begin
-        match Sys.os_type with
-          | "Win32" ->
-              OASISExec.run ~ctxt "rd" [q tgt]
-          | _ ->
-              OASISExec.run ~ctxt "rm" ["-r"; q tgt]
-      end
+    if Sys.readdir tgt = [||] then begin
+      match Sys.os_type with
+        | "Win32" ->
+            OASISExec.run ~ctxt "rd" [q tgt]
+        | _ ->
+            OASISExec.run ~ctxt "rm" ["-r"; q tgt]
+    end else begin
+      OASISMessage.error ~ctxt
+        (f_ "Cannot remove directory '%s': not empty.")
+        tgt
+    end
 
 
   let glob ~ctxt fn =
@@ -2802,7 +2895,7 @@ module OASISFileUtil = struct
 end
 
 
-# 2785 "setup.ml"
+# 2878 "setup.ml"
 module BaseEnvLight = struct
 # 22 "src/base/BaseEnvLight.ml"
 
@@ -2907,7 +3000,7 @@ module BaseEnvLight = struct
 end
 
 
-# 2890 "setup.ml"
+# 2983 "setup.ml"
 module BaseContext = struct
 # 22 "src/base/BaseContext.ml"
 
@@ -5318,7 +5411,7 @@ module BaseSetup = struct
 end
 
 
-# 5301 "setup.ml"
+# 5394 "setup.ml"
 module InternalConfigurePlugin = struct
 # 22 "src/plugins/internal/InternalConfigurePlugin.ml"
 
@@ -6167,7 +6260,7 @@ module InternalInstallPlugin = struct
 end
 
 
-# 6150 "setup.ml"
+# 6243 "setup.ml"
 module OCamlbuildCommon = struct
 # 22 "src/plugins/ocamlbuild/OCamlbuildCommon.ml"
 
@@ -6540,7 +6633,7 @@ module OCamlbuildDocPlugin = struct
 end
 
 
-# 6523 "setup.ml"
+# 6616 "setup.ml"
 module CustomPlugin = struct
 # 22 "src/plugins/custom/CustomPlugin.ml"
 
@@ -6688,9 +6781,8 @@ module CustomPlugin = struct
 end
 
 
-# 6671 "setup.ml"
+# 6764 "setup.ml"
 open OASISTypes;;
-
 let setup_t =
   {
      BaseSetup.configure = InternalConfigurePlugin.configure;
@@ -6950,7 +7042,7 @@ let setup_t =
           alpha_features = [];
           beta_features = [];
           name = "oasis";
-          version = "0.4.3";
+          version = "0.4.4";
           license =
             OASISLicense.DEP5License
               (OASISLicense.DEP5Unit
@@ -6968,7 +7060,22 @@ let setup_t =
             "Architecture for building OCaml libraries and applications";
           description =
             Some
-              "OASIS generates a full configure, build and install system for 
your\napplication. It starts with a simple `_oasis` file at the toplevel of 
your\nproject and creates everything required.\n\nIt uses external tools like 
OCamlbuild and it can be considered as the glue\nbetween various subsystems 
that do the job. It should support the following\ntools:\n\n * OCamlbuild\n * 
OMake (todo)\n * OCamlMakefile (todo),\n * ocaml-autoconf (todo)\n\nIt also 
features a do-it-yourself comm [...]
+              [
+                 OASISText.Para
+                   "OASIS generates a full configure, build and install system 
for your application. It starts with a simple `_oasis` file at the toplevel of 
your project and creates everything required.";
+                 OASISText.Para
+                   "It uses external tools like OCamlbuild and it can be 
considered as the glue between various subsystems that do the job. It should 
support the following tools:";
+                 OASISText.BlankLine;
+                 OASISText.Verbatim "* OCamlbuild";
+                 OASISText.Verbatim "* OMake (todo)";
+                 OASISText.Verbatim "* OCamlMakefile (todo),";
+                 OASISText.Verbatim "* ocaml-autoconf (todo)";
+                 OASISText.BlankLine;
+                 OASISText.Para
+                   "It also features a do-it-yourself command line invocation 
and an internal configure/install scheme. Libraries are managed through 
findlib. It has been tested on GNU Linux and Windows.";
+                 OASISText.Para
+                   "It also allows to have standard entry points and 
description. It helps to integrates your libraries and software with third 
parties tools like GODI."
+              ];
           categories = [];
           conf_type = (`Configure, "internal", Some "0.4");
           conf_custom =
@@ -7986,21 +8093,19 @@ let setup_t =
                (`Extra, "StdFiles", Some "0.3");
                (`Extra, "META", Some "0.3")
             ];
+          disable_oasis_section = [];
           schema_data = PropList.Data.create ();
           plugin_data = []
        };
      oasis_fn = Some "_oasis";
-     oasis_version = "0.4.2";
-     oasis_digest =
-       Some "\007\147\235\163\172\156H\213\244\177\223\169\169\017m+";
+     oasis_version = "0.4.3";
+     oasis_digest = Some "(\028\230*-\134kE#\141~\018\234\153h\197";
      oasis_exec = None;
      oasis_setup_args = [];
      setup_update = false
   };;
-
 let setup () = BaseSetup.setup setup_t;;
-
-# 7984 "setup.ml"
+# 8092 "setup.ml"
 (* OASIS_STOP *)
 
 #use "deps.ml";;
diff --git a/src/ext/plugin-loader/src/META b/src/ext/plugin-loader/src/META
index 4a1f515..628208a 100644
--- a/src/ext/plugin-loader/src/META
+++ b/src/ext/plugin-loader/src/META
@@ -21,8 +21,8 @@
 
################################################################################
 
 # OASIS_START
-# DO NOT EDIT (digest: ec8a568df24054f16a4185c2b8e64df3)
-version = "0.4.3"
+# DO NOT EDIT (digest: b67d15a98a5c38745bf0f65aeb1c838b)
+version = "0.4.4"
 description = "Architecture for building OCaml libraries and applications"
 requires = "dynlink findlib"
 archive(byte) = "plugin-loader.cma"
diff --git a/src/ext/plugin-loader/test/data/findlib/plugin1/META 
b/src/ext/plugin-loader/test/data/findlib/plugin1/META
index 9d6a275..ee4e533 100644
--- a/src/ext/plugin-loader/test/data/findlib/plugin1/META
+++ b/src/ext/plugin-loader/test/data/findlib/plugin1/META
@@ -21,8 +21,8 @@
 
################################################################################
 
 # OASIS_START
-# DO NOT EDIT (digest: 8046a1228063d88dd4e33144fdc409a6)
-version = "0.4.3"
+# DO NOT EDIT (digest: 9032562b1c1063db98bbe0a1a8827025)
+version = "0.4.4"
 description = "Architecture for building OCaml libraries and applications"
 requires = "pluginloaderLib"
 archive(byte) = "plugin1.cma"
diff --git a/src/ext/plugin-loader/test/data/findlib/plugin2/META 
b/src/ext/plugin-loader/test/data/findlib/plugin2/META
index ecb4083..773e558 100644
--- a/src/ext/plugin-loader/test/data/findlib/plugin2/META
+++ b/src/ext/plugin-loader/test/data/findlib/plugin2/META
@@ -21,8 +21,8 @@
 
################################################################################
 
 # OASIS_START
-# DO NOT EDIT (digest: c63164f591b9618538dfe7b4d54c5be4)
-version = "0.4.3"
+# DO NOT EDIT (digest: 0a6d84518b3cbef2fef93c73ccab58b7)
+version = "0.4.4"
 description = "Architecture for building OCaml libraries and applications"
 requires = "pluginloaderLib plugin1"
 archive(byte) = "plugin2.cma"
diff --git a/src/ext/plugin-loader/test/data/findlib/plugin3/META 
b/src/ext/plugin-loader/test/data/findlib/plugin3/META
index cecbadd..7175bfd 100644
--- a/src/ext/plugin-loader/test/data/findlib/plugin3/META
+++ b/src/ext/plugin-loader/test/data/findlib/plugin3/META
@@ -21,8 +21,8 @@
 
################################################################################
 
 # OASIS_START
-# DO NOT EDIT (digest: faa1a9f52725a0f0546f830da5ec75b6)
-version = "0.4.3"
+# DO NOT EDIT (digest: 026d5b3faaaa7c685ab389d814a2c0ec)
+version = "0.4.4"
 description = "Architecture for building OCaml libraries and applications"
 requires = "pluginloaderLib"
 archive(byte) = "plugin3.cma"
diff --git a/src/ext/plugin-loader/test/data/findlib/pluginloaderLib/META 
b/src/ext/plugin-loader/test/data/findlib/pluginloaderLib/META
index 5a20b4f..3972db7 100644
--- a/src/ext/plugin-loader/test/data/findlib/pluginloaderLib/META
+++ b/src/ext/plugin-loader/test/data/findlib/pluginloaderLib/META
@@ -21,8 +21,8 @@
 
################################################################################
 
 # OASIS_START
-# DO NOT EDIT (digest: bd9a9cf9be2762f660c15a296475ef2b)
-version = "0.4.3"
+# DO NOT EDIT (digest: c08f8e34cb2e2ced0a8a48a53ba8d7a0)
+version = "0.4.4"
 description = "Architecture for building OCaml libraries and applications"
 archive(byte) = "pluginloaderLib.cma"
 archive(byte, plugin) = "pluginloaderLib.cma"
diff --git a/src/ext/userconf/src/META b/src/ext/userconf/src/META
index 8c21bc7..7b21e8b 100644
--- a/src/ext/userconf/src/META
+++ b/src/ext/userconf/src/META
@@ -21,8 +21,8 @@
 
################################################################################
 
 # OASIS_START
-# DO NOT EDIT (digest: 05bee45994b384bbbbb95444de41fd24)
-version = "0.4.3"
+# DO NOT EDIT (digest: 622ec995be8ad418d00a8ad7181c8fa3)
+version = "0.4.4"
 description = "Architecture for building OCaml libraries and applications"
 archive(byte) = "userconf.cma"
 archive(byte, plugin) = "userconf.cma"
diff --git a/src/oasis/META b/src/oasis/META
index 45dd7f8..796cbef 100644
--- a/src/oasis/META
+++ b/src/oasis/META
@@ -21,8 +21,8 @@
 
################################################################################
 
 # OASIS_START
-# DO NOT EDIT (digest: bfbe6948aab45bf3c9768a5f754185ee)
-version = "0.4.3"
+# DO NOT EDIT (digest: 050043f65990987fd8dfb36bbab063f3)
+version = "0.4.4"
 description = "_oasis file functions"
 requires = "unix odn"
 archive(byte) = "oasis.cma"
@@ -31,7 +31,7 @@ archive(native) = "oasis.cmxa"
 archive(native, plugin) = "oasis.cmxs"
 exists_if = "oasis.cma"
 package "dynrun" (
- version = "0.4.3"
+ version = "0.4.4"
  description = "_oasis file functions"
  requires = "oasis.base oasis.builtin-plugins"
  archive(byte) = "dynrun.cma"
@@ -42,7 +42,7 @@ package "dynrun" (
 )
 
 package "cli" (
- version = "0.4.3"
+ version = "0.4.4"
  description = "'setup.ml' modules for OASIS"
  requires = "oasis oasis.base plugin-loader"
  archive(byte) = "cli.cma"
@@ -51,7 +51,7 @@ package "cli" (
 )
 
 package "builtin-plugins" (
- version = "0.4.3"
+ version = "0.4.4"
  description = "_oasis file functions"
  requires = "oasis oasis.base ocamlbuild"
  archive(byte) = "builtin-plugins.cma"
@@ -62,7 +62,7 @@ package "builtin-plugins" (
 )
 
 package "base" (
- version = "0.4.3"
+ version = "0.4.4"
  description = "'setup.ml' modules for OASIS"
  requires = "oasis"
  archive(byte) = "base.cma"
diff --git a/src/oasis/OASISFileTemplate.ml b/src/oasis/OASISFileTemplate.ml
index fe2cdaa..5f7979f 100644
--- a/src/oasis/OASISFileTemplate.ml
+++ b/src/oasis/OASISFileTemplate.ml
@@ -28,6 +28,12 @@ open OASISTypes
 open OASISString
 
 
+(* TODO: logic of this file is brittle, we update digest frequently and not
+ * always with the same content.
+ * Proposal: create functions add_string [`Header|`Body|`Footer] t str (side
+ * effect) and update digest into a single place.
+ *)
+
 type comment =
     {
       (** Return the string as a comment. *)
@@ -395,9 +401,8 @@ let digest_update t =
            | NoBody -> NoBody
            | BodyWithDigest (_, lst)
            | Body lst ->
-               BodyWithDigest
-                 (Digest.string (String.concat "\n" lst),
-                  lst)}
+               let d = Digest.string (String.concat "\n" lst) in
+                 BodyWithDigest(d, lst)}
 
 
 let digest_check t =
@@ -410,14 +415,15 @@ let digest_check t =
 
 
 let merge t_org t_new =
-  {t_new with
-       header = t_org.header;
-       body   =
-         (if t_org.body = NoBody then
-            t_org.body
-          else
-            t_new.body);
-       footer = t_org.footer}
+  digest_update
+    {t_new with
+         header = t_org.header;
+         body   =
+           (if t_org.body = NoBody then
+              t_org.body
+            else
+              t_new.body);
+         footer = t_org.footer}
 
 
 let to_string_list t =
@@ -427,12 +433,7 @@ let to_string_list t =
    * each part by appropriate comment and digest.
    *)
   let split_further lst =
-    List.rev
-      (List.fold_left
-         (fun lst str ->
-            let lst' = OASISString.split_newline ~do_trim:false str in
-              List.rev_append lst' lst)
-         [] lst)
+    split_newline ~do_trim:false (String.concat "\n" lst)
   in
   let oasis_section =
     match t.body with
@@ -491,20 +492,15 @@ let file_rollback ~ctxt =
         (try Sys.remove fn with _ -> ())
 
     | Change (fn, Some bak) ->
-        begin
-          if Sys.file_exists bak then
-            begin
-              info ~ctxt (f_ "Restore file '%s' with backup file '%s'.")
-                fn bak;
-              Sys.rename bak fn
-            end
-          else
-            begin
-              warning ~ctxt
-                (f_ "Backup file '%s' disappear, cannot restore \
-                     file '%s'.")
-                bak fn
-            end
+        if Sys.file_exists bak then begin
+          info ~ctxt (f_ "Restore file '%s' with backup file '%s'.")
+            fn bak;
+          Sys.rename bak fn
+        end else begin
+          warning ~ctxt
+            (f_ "Backup file '%s' disappear, cannot restore \
+                 file '%s'.")
+            bak fn
         end
 
     | Change (fn, None) ->
@@ -547,20 +543,14 @@ let file_generate ~ctxt ?(remove=false) ~backup t =
     let rec backup_aux =
       function
         | ext :: tl ->
-            begin
-              let fn_backup =
-                fn ^ "." ^ ext
-              in
-                if not (Sys.file_exists fn_backup) then
-                  begin
-                    Sys.rename fn fn_backup;
-                    OASISFileUtil.cp ~ctxt fn_backup fn;
-                    fn_backup
-                  end
-                else
-                  begin
-                    backup_aux tl
-                  end
+            let fn_backup = fn ^ "." ^ ext in
+            if not (Sys.file_exists fn_backup) then begin
+              info ~ctxt (f_ "Rename '%s' to '%s'.") fn fn_backup;
+              Sys.rename fn fn_backup;
+              OASISFileUtil.cp ~ctxt fn_backup fn;
+              fn_backup
+            end else begin
+              backup_aux tl
             end
 
         | [] ->
diff --git a/test/TestFileTemplate.ml b/test/TestFileTemplate.ml
index aa9fa0f..e745697 100644
--- a/test/TestFileTemplate.ml
+++ b/test/TestFileTemplate.ml
@@ -31,6 +31,16 @@ open TestCommon
 open OASISFileTemplate
 
 
+let printer_change =
+  function
+    | Create fn -> Printf.sprintf "Create %S" fn
+    | Change (fn, Some fn') ->
+        Printf.sprintf "Change (%S, Some %s)" fn fn'
+    | Change (fn, None) ->
+        Printf.sprintf "Change (%S, None)" fn
+    | NoChange ->
+        "NoChange"
+
 let tests =
 
   let test_of_vector (fn, content_lst, comment_fmt) =
@@ -134,8 +144,9 @@ let tests =
        let () =
          skip_if (Sys.os_type = "Win32") "UNIX only test"
        in
-       (* TODO: temporary directory and ensure to keep the same right. *)
-       let fn, chn = bracket_tmpfile test_ctxt in
+       let dn = bracket_tmpdir test_ctxt in
+       let fn = Filename.concat dn "foo.sh" in
+       let chn = open_out fn in
        let () =
          output_string
            chn
@@ -169,7 +180,6 @@ let tests =
        let chng =
          file_generate
            ~ctxt:oasis_ctxt
-           (* TODO: in a temporary directory. *)
            ~backup:true
            (template_make
               fn
@@ -183,5 +193,22 @@ let tests =
            ~msg:"File chgrp"
            ~printer:string_of_int
            grp
-           ((Unix.stat fn).Unix.st_gid))
+           ((Unix.stat fn).Unix.st_gid));
+
+    "bug1382-keep all eol" >::
+    (fun test_ctxt ->
+       let dn = bracket_tmpdir test_ctxt in
+       let fn = Filename.concat dn "foo.txt" in
+       let ghost_meta_template =
+         template_make fn comment_meta [] ["nothing"; ""; "bar"] []
+       in
+         assert_equal
+           ~printer:printer_change
+           (Create fn)
+           (file_generate ~ctxt:oasis_ctxt ~backup:false ghost_meta_template);
+         assert_equal
+           ~printer:printer_change
+           NoChange
+           (file_generate ~ctxt:oasis_ctxt ~backup:false ghost_meta_template);
+         ());
   ]

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-ocaml-maint/packages/oasis.git

_______________________________________________
Pkg-ocaml-maint-commits mailing list
Pkg-ocaml-maint-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits

Reply via email to