]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/matitaclean.ml
* Part of matita that used to deal with the library moved into ocaml/library
[helm.git] / helm / matita / matitaclean.ml
index 5aabf7558dab32467027798a40446199f0fc3646..807f545258ff899ac98eaa226b8fd3352b14ad18 100644 (file)
@@ -32,10 +32,11 @@ let main () =
   let _ = MatitaInit.initialize_all () in
   let uris_to_remove = ref [] in
   let files_to_remove = ref [] in
+  let basedir = Helm_registry.get "matita.basedir" in
   (match Helm_registry.get_list Helm_registry.string "matita.args" with
   | [ "all" ] ->
-      MatitaDb.clean_owner_environment ();
-      let xmldir = Helm_registry.get "matita.basedir" ^ "/xml" in
+      LibraryDb.clean_owner_environment ();
+      let xmldir = basedir ^ "/xml" in
       ignore
        (Sys.command
          ("find " ^ xmldir ^
@@ -54,9 +55,9 @@ let main () =
               UM.buri_of_uri (UM.uri_of_string suri)
             with UM.IllFormedUri _ ->
               files_to_remove := suri :: !files_to_remove;
-              let u = MatitacleanLib.baseuri_of_file suri in
+              let u = MatitaMisc.baseuri_of_file suri in
               if String.length u < 5 || String.sub u 0 5 <> "cic:/" then begin
-                MatitaLog.error (sprintf "File %s defines a bad baseuri: %s"
+                HLog.error (sprintf "File %s defines a bad baseuri: %s"
                   suri u);
                 exit 1
               end else
@@ -64,7 +65,9 @@ let main () =
           in
           uris_to_remove := uri :: !uris_to_remove)
         files);
-  MatitacleanLib.clean_baseuris !uris_to_remove;
-  let moos = List.map MatitacleanLib.obj_file_of_script !files_to_remove in
-  List.iter MatitaMisc.safe_remove moos
+  LibraryClean.clean_baseuris ~basedir !uris_to_remove;
+  let moos =
+   List.map (MatitaMisc.obj_file_of_script ~basedir) !files_to_remove
+  in
+   List.iter HExtlib.safe_remove moos