From 23f26304a9132e09105d6580a1d3caf72053a859 Mon Sep 17 00:00:00 2001 From: herbelin Date: Thu, 26 Nov 2009 16:28:17 +0000 Subject: Fixing xml theory file export (was not consistent with coqdoc file naming heuristic). Added a corresponding test. Note: maybe should the generated .v file for exporting the theory be made of a valid ident if ever coqdoc eventually follows coq convention: currently it has name foo.theory.v which is not coqc-compilable. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12543 85f007b7-540e-0410-9357-904b9bb8a0f7 --- plugins/xml/xmlcommand.ml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/xml') diff --git a/plugins/xml/xmlcommand.ml b/plugins/xml/xmlcommand.ml index 294f5154d..b3b2e2654 100644 --- a/plugins/xml/xmlcommand.ml +++ b/plugins/xml/xmlcommand.ml @@ -660,23 +660,23 @@ let _ = None -> Buffer.output_buffer stdout theory_buffer ; | Some fn -> - let ch = open_out (fn ^ ".v") in + let ch = open_out (fn ^ ".v") in Buffer.output_buffer ch theory_buffer ; + close_out ch; + (* dummy glob file *) + let ch = open_out (fn ^ ".glob") in close_out ch end ; Option.iter (fun fn -> let coqdoc = Filename.concat (Envars.coqbin ()) ("coqdoc" ^ Coq_config.exec_extension) in let options = " --html -s --body-only --no-index --latin1 --raw-comments" in - let dir = Option.get xml_library_root in let command cmd = if Sys.command cmd <> 0 then Util.anomaly ("Error executing \"" ^ cmd ^ "\"") in - command (coqdoc^options^" -d "^dir^" "^fn^".v"); - let dot = if fn.[0]='/' then "." else "" in - command ("mv "^dir^"/"^dot^"*.html "^fn^".xml "); - command ("rm "^fn^".v"); + command (coqdoc^options^" -o "^fn^".xml "^fn^".v"); + command ("rm "^fn^".v "^fn^".glob"); print_string("\nWriting on file \"" ^ fn ^ ".xml\" was successful\n")) ofn) ;; -- cgit v1.2.3