]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/matitaclean.ml
matitamake stuff:
[helm.git] / helm / matita / matitaclean.ml
index 60866fc1ae4702ff63df56cccc643a16040841da..df6fdfecb6c09457a9c14f7952ba84d2e43ecd5d 100644 (file)
@@ -2,7 +2,7 @@ module UM = UriManager;;
 module TA = TacticAst;;
 
 let _ =
-  Helm_registry.load_from "matita.conf.xml";
+  Helm_registry.load_from BuildTimeConf.matita_conf;
   Http_getter.init ();
   MetadataTypes.ownerize_tables (Helm_registry.get "matita.owner");
   MatitaDb.create_owner_environment ()
@@ -37,7 +37,14 @@ let _ =
         with
           UM.IllFormedUri _ ->
            files_to_remove := suri :: !files_to_remove;
-           MatitacleanLib.baseuri_of_file suri
+           let u = MatitacleanLib.baseuri_of_file suri in
+           if String.length u < 5 || String.sub u 0 5 <> "cic:/" then
+             begin
+               MatitaLog.error ("File " ^ suri ^ " defines a bad baseuri: "^u);
+               exit 1
+             end
+           else
+             u
       in
       uris_to_remove := uri :: !uris_to_remove
     done
@@ -45,5 +52,7 @@ let _ =
     Invalid_argument _ -> usage ());
   main !uris_to_remove;
   let moos = List.map MatitaMisc.obj_file_of_script !files_to_remove in
-   List.iter
-    (fun s -> try Unix.unlink s with Unix.Unix_error _ -> ()) moos
+  List.iter
+    (fun s -> try Unix.unlink s with Unix.Unix_error _ -> ()) 
+    moos
+