+ (* sanity checks *)
+ let moo_fname =
+ LibraryMisc.obj_file_of_baseuri ~must_exist:false ~baseuri ~writable:true
+ in
+ let lexicon_fname=
+ LibraryMisc.lexicon_file_of_baseuri ~must_exist:false ~baseuri ~writable:true
+ in
+ if Http_getter_storage.is_read_only baseuri then
+ HLog.error
+ (Printf.sprintf "uri %s belongs to a read-only repository" baseuri);
+ (* cleanup of previously compiled objects *)
+ if (not (Http_getter_storage.is_empty ~local:true baseuri) ||
+ LibraryClean.db_uris_of_baseuri baseuri <> [])
+ then begin
+ HLog.message ("baseuri " ^ baseuri ^ " is not empty");
+ HLog.message ("cleaning baseuri " ^ baseuri);
+ LibraryClean.clean_baseuris [baseuri];
+ assert (Http_getter_storage.is_empty ~local:true baseuri);
+ end;
+ (* create dir for XML files *)
+ if not (Helm_registry.get_opt_default Helm_registry.bool "matita.nodisk"
+ ~default:false)
+ then
+ HExtlib.mkdir
+ (Filename.dirname
+ (Http_getter.filename ~local:true ~writable:true (baseuri ^
+ "foo.con")));
+ HLog.message ("compiling " ^ Filename.basename fname ^ " in " ^ baseuri);
+ if not (Helm_registry.get_bool "matita.verbose") then
+ (let cc =
+ if Str.string_match(Str.regexp ".*opt$") Sys.argv.(0) 0 then "matitac.opt"
+ else "matitac"
+ in
+ let s = Printf.sprintf "%s %-35s " cc (cut (root^"/") fname) in
+ print_string s; flush stdout);
+ let buf = Ulexing.from_utf8_channel (open_in fname) in
+ let print_cb =
+ if not (Helm_registry.get_bool "matita.verbose") then (fun _ _ -> ())
+ else pp_ast_statement
+ in