[Pkg-ocaml-maint-commits] [SCM] ocaml-melt packaging branch, master, updated. upstream/1.3.0-5-g7f466e9

Stephane Glondu steph at glondu.net
Mon Oct 18 12:14:44 UTC 2010


The following commit has been merged in the master branch:
commit 7f466e9edc651b035c8d1ab4a3df56bfc0931efe
Author: Stephane Glondu <steph at glondu.net>
Date:   Mon Oct 18 14:12:42 2010 +0200

    Add 0002-Remove-temporary-files-in-melt-tool-as-well.patch

diff --git a/debian/patches/0002-Remove-temporary-files-in-melt-tool-as-well.patch b/debian/patches/0002-Remove-temporary-files-in-melt-tool-as-well.patch
new file mode 100644
index 0000000..bb84c6f
--- /dev/null
+++ b/debian/patches/0002-Remove-temporary-files-in-melt-tool-as-well.patch
@@ -0,0 +1,53 @@
+From: Stephane Glondu <steph at glondu.net>
+Date: Mon, 18 Oct 2010 14:11:29 +0200
+Subject: [PATCH] Remove temporary files in melt tool as well
+
+This is done by updating the piece of code copied from totoconf.ml in
+melt/tool.ml...
+
+Signed-off-by: Stephane Glondu <steph at glondu.net>
+---
+ melt/tool.ml |   26 ++++++++++++++++++++------
+ 1 files changed, 20 insertions(+), 6 deletions(-)
+
+diff --git a/melt/tool.ml b/melt/tool.ml
+index c06593a..e6c223b 100644
+--- a/melt/tool.ml
++++ b/melt/tool.ml
+@@ -33,15 +33,29 @@ open Printf
+ (* From Totoconf *)
+ exception Exec_error of int
+ 
++let try_finally f g =
++  let result =
++    try
++      f ();
++    with exn ->
++      g ();
++    raise exn
++  in
++  (g (): unit);
++  result
++
+ let exec_line cmd args =
+   let c = String.concat " " (cmd::args) in
+   let tmp = Filename.temp_file "configure_exec_line" ".out" in
+-  try
+-    match Sys.command (c ^ " > " ^ tmp) with
+-      | 0 -> input_line (open_in tmp)
+-      | n -> raise (Exec_error n)
+-  with End_of_file ->
+-    ""
++  try_finally
++    (fun () ->
++      try
++        match Sys.command (c ^ " > " ^ tmp) with
++          | 0 -> input_line (open_in tmp)
++          | n -> raise (Exec_error n)
++      with End_of_file ->
++        "")
++    (fun () -> Sys.remove tmp)
+ (* *)
+ 
+ let files = Queue.create ()
+-- 
diff --git a/debian/patches/series b/debian/patches/series
index 637d0c0..29b4a4c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 0001-usr-bin-melt-meltbuild.patch
+0002-Remove-temporary-files-in-melt-tool-as-well.patch

-- 
ocaml-melt packaging



More information about the Pkg-ocaml-maint-commits mailing list