[Pkg-ocaml-maint-commits] [SCM] jocaml packaging branch, master, updated. debian/3.11.0-3-23-g34a742d
Mehdi Dogguy
dogguy at pps.jussieu.fr
Tue Jul 7 19:23:49 UTC 2009
The following commit has been merged in the master branch:
commit 1bb7b5f0c9bfdec5556f2b3ff1d15fe6e57c1197
Author: Mehdi Dogguy <dogguy at pps.jussieu.fr>
Date: Tue Jul 7 18:05:17 2009 +0200
Add option -v to expunge to select modules to filter instead of modules to keep
diff --git a/debian/patches/0002-Add-option-v-to-expunge-to-select-modules-to-filter-.patch b/debian/patches/0002-Add-option-v-to-expunge-to-select-modules-to-filter-.patch
new file mode 100644
index 0000000..1834a23
--- /dev/null
+++ b/debian/patches/0002-Add-option-v-to-expunge-to-select-modules-to-filter-.patch
@@ -0,0 +1,51 @@
+From: Mehdi Dogguy <dogguy at pps.jussieu.fr>
+Date: Tue, 7 Jul 2009 18:03:42 +0200
+Subject: [PATCH] Add option -v to expunge to select modules to filter instead of modules to keep
+
+---
+ toplevel/expunge.ml | 22 ++++++++++++++--------
+ 1 files changed, 14 insertions(+), 8 deletions(-)
+
+diff --git a/toplevel/expunge.ml b/toplevel/expunge.ml
+index 05a4fe0..49fa91f 100644
+--- a/toplevel/expunge.ml
++++ b/toplevel/expunge.ml
+@@ -24,23 +24,29 @@ module StringSet =
+ let compare = compare
+ end)
+
++let is_exn =
++ let h = Hashtbl.create 64 in
++ Array.iter (fun n -> Hashtbl.add h n ()) Runtimedef.builtin_exceptions;
++ Hashtbl.mem h
++
+ let to_keep = ref StringSet.empty
+
++let negate = Sys.argv.(3) = "-v"
++
++let keep =
++ if negate then fun name -> is_exn name || not (StringSet.mem name !to_keep)
++ else fun name -> is_exn name || (StringSet.mem name !to_keep)
++
+ let expunge_map tbl =
+- Symtable.filter_global_map
+- (fun id -> StringSet.mem (Ident.name id) !to_keep)
+- tbl
++ Symtable.filter_global_map (fun id -> keep (Ident.name id)) tbl
+
+ let expunge_crcs tbl =
+- List.filter (fun (unit, crc) -> StringSet.mem unit !to_keep) tbl
++ List.filter (fun (unit, crc) -> keep unit) tbl
+
+ let main () =
+ let input_name = Sys.argv.(1) in
+ let output_name = Sys.argv.(2) in
+- Array.iter
+- (fun exn -> to_keep := StringSet.add exn !to_keep)
+- Runtimedef.builtin_exceptions;
+- for i = 3 to Array.length Sys.argv - 1 do
++ for i = (if negate then 4 else 3) to Array.length Sys.argv - 1 do
+ to_keep := StringSet.add (String.capitalize Sys.argv.(i)) !to_keep
+ done;
+ let ic = open_in_bin input_name in
+--
diff --git a/debian/patches/series b/debian/patches/series
index 2a3c543..3937513 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
0001-Replace-Otyp_proc-with-Otyp_stuff-to-make-outcometre.patch
+0002-Add-option-v-to-expunge-to-select-modules-to-filter-.patch
--
jocaml packaging
More information about the Pkg-ocaml-maint-commits
mailing list