[Pkg-ocaml-maint-commits] [SCM] unison packaging branch, master, updated. debian/2.32.52-1

Sylvain Le Gall gildor at debian.org
Sat Feb 27 18:58:25 UTC 2010


The following commit has been merged in the master branch:
commit 47703c669879a67787e3fbc598986465516c5edd
Author: Sylvain Le Gall <gildor at debian.org>
Date:   Sat Feb 27 16:22:35 2010 +0100

    Create a script for merging

diff --git a/debian/git-merge.ml b/debian/git-merge.ml
new file mode 100755
index 0000000..f6fdad5
--- /dev/null
+++ b/debian/git-merge.ml
@@ -0,0 +1,45 @@
+#!/usr/bin/ocamlrun ocaml
+
+#use "topfind";;
+#require "fileutils";;
+
+open FileUtil;;
+
+let save fn =
+  let tmp =
+    Filename.temp_file ("unison-merge-"^(Filename.basename fn)) ".bak"
+  in
+    cp [fn] tmp;
+    fn, tmp
+
+let restore ?(ext="") (fn, tmp) =
+  mv [tmp] (fn^ext)
+
+let fns = 
+  [
+    "debian/changelog";
+    "debian/control";
+    "debian/gbp.conf";
+  ]
+
+let baks =
+  List.rev_map save fns
+
+let () = 
+  try 
+    let cmd = 
+      "git merge "^(String.concat " " (List.tl (Array.to_list Sys.argv)))
+    in
+      prerr_endline ("Runnning "^cmd);
+      match Sys.command cmd with 
+        | 0 ->
+            List.iter restore baks
+        | n ->
+            Printf.eprintf 
+              "Command '%s' exited with code %d/n%!" 
+              cmd
+              n;
+            List.iter (restore ~ext:".old") baks
+
+  with e ->
+    rm ~force:true (List.map snd baks)

-- 
unison packaging



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