summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ocamlbuild/TODO2
-rw-r--r--ocamlbuild/fda.ml2
-rw-r--r--ocamlbuild/hygiene.ml9
3 files changed, 9 insertions, 4 deletions
diff --git a/ocamlbuild/TODO b/ocamlbuild/TODO
index bc34c245e..d1465bd7e 100644
--- a/ocamlbuild/TODO
+++ b/ocamlbuild/TODO
@@ -1,8 +1,6 @@
To do:
* Add rules for producing .recdepends from .ml, .mli, .mllib, .mlpack
* Produce a dependency subgraph when failing on circular deps (e.g. "A: B C\nB: D")
-* rm sanitize.sh during -clean
-* rm sanitize.sh when running ocamlbuild
* Export my_unix_with_unix and executor (and change its name)
* Executor: exceptional conditions and Not_found
* Fix report
diff --git a/ocamlbuild/fda.ml b/ocamlbuild/fda.ml
index 919f9e966..1b4352776 100644
--- a/ocamlbuild/fda.ml
+++ b/ocamlbuild/fda.ml
@@ -49,7 +49,7 @@ let inspect entry =
?sanitize:
begin
if !Options.sanitize then
- Some(!Options.sanitization_script)
+ Some(Pathname.concat !Options.build_dir !Options.sanitization_script)
else
None
end
diff --git a/ocamlbuild/hygiene.ml b/ocamlbuild/hygiene.ml
index 365c99dfb..cde8fdfd6 100644
--- a/ocamlbuild/hygiene.ml
+++ b/ocamlbuild/hygiene.ml
@@ -58,6 +58,11 @@ module SS = Set.Make(String);;
let check ?sanitize laws entry =
let penalties = ref [] in
let microbes = ref SS.empty in
+ let () =
+ match sanitize with
+ | Some fn -> if sys_file_exists fn then sys_remove fn
+ | None -> ()
+ in
let remove path name =
if sanitize <> None then
microbes := SS.add (filename_concat path name) !microbes
@@ -149,7 +154,9 @@ let check ?sanitize laws entry =
let fp = Printf.fprintf in
fp oc "#!/bin/sh\n\
# File generated by ocamlbuild\n\
- \n";
+ \n\
+ cd %s\n\
+ \n" (Shell.quote_filename_if_needed Pathname.pwd);
SS.iter
begin fun fn ->
fp oc "rm -f %s\n" (Shell.quote_filename_if_needed fn)