+
+let get_all_scripts () =
+ match L.find_roots_in_dir (Sys.getcwd ()) with
+ | [root] ->
+ let bdir = Filename.dirname root in
+ HExtlib.find ~test:(fun x -> Filename.check_suffix x ".ma") bdir
+ | [] ->
+ prerr_endline "no roots found"; exit 1
+ | roots ->
+ let roots = List.map (HExtlib.chop_prefix (Sys.getcwd()^"/")) roots in
+ prerr_endline ("Too many roots found:\n\t" ^ String.concat "\n\t" roots);
+ prerr_endline ("\nEnter one of these directories and retry");
+ exit 1
+
+let remove_all_items items =
+ let map item =
+ if L.is_uri item then item else
+ let _,buri,_,_ = L.baseuri_of_script ~include_paths:[] item in
+ buri
+ in
+(*MATITA 1.0, CSC: verify that uris_to_remove are reasonable uris *)
+ let uris_to_remove = List.map map items in
+ LibraryClean.clean_baseuris ~verbose:true uris_to_remove
+
+(* FG: Old code kept for reference
+
+ let uri =
+ (*try*)
+ NUri.baseuri_of_uri (NUri.uri_of_string suri)
+ (*with UM.IllFormedUri _ ->
+ let _,u,_,_ = L.baseuri_of_script ~include_paths:[] suri in
+ if L.is_uri u then u else begin
+ HLog.error (sprintf "File %s defines a bad baseuri: %s" suri u);
+ exit 1
+ end *)
+*)