From 64de8737135a82d968572abb5a7456b6e3bc28ef Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Thu, 7 Jul 2005 09:31:41 +0000 Subject: [PATCH] now tables are recreated if needed and mattiaclean all really clears the owner env (purging tables that will be recreated by matita/c) --- helm/matita/matitaDb.ml | 5 +---- helm/matita/matitaDb.mli | 2 +- helm/matita/matitaclean.ml | 6 ++++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/helm/matita/matitaDb.ml b/helm/matita/matitaDb.ml index 4e8691f93..b5b64d46f 100644 --- a/helm/matita/matitaDb.ml +++ b/helm/matita/matitaDb.ml @@ -105,6 +105,7 @@ let create_owner_environment () = let status = Mysql.status dbd in match status with | Mysql.StatusError Mysql.Table_exists_error -> () + | Mysql.StatusError Mysql.Dup_keyname -> () | Mysql.StatusError _ -> raise exn | _ -> () ) statements @@ -163,7 +164,3 @@ let xpointers_of_ind uri = Mysql.iter rc (fun a -> match a.(0) with None ->()|Some a -> l := a:: !l); List.map UriManager.uri_of_string !l -let reset_owner_environment () = - clean_owner_environment (); - create_owner_environment () - diff --git a/helm/matita/matitaDb.mli b/helm/matita/matitaDb.mli index f6d8c1fd1..09eff2989 100644 --- a/helm/matita/matitaDb.mli +++ b/helm/matita/matitaDb.mli @@ -25,8 +25,8 @@ val instance: unit -> Mysql.dbd -val reset_owner_environment : unit -> unit val create_owner_environment: unit -> unit +val clean_owner_environment: unit -> unit val remove_uri: UriManager.uri -> string list val xpointers_of_ind: UriManager.uri -> UriManager.uri list diff --git a/helm/matita/matitaclean.ml b/helm/matita/matitaclean.ml index f14c5e80e..1ee09d968 100644 --- a/helm/matita/matitaclean.ml +++ b/helm/matita/matitaclean.ml @@ -12,7 +12,9 @@ let usage () = prerr_endline ""; prerr_endline "usage:"; prerr_endline "\tmatitaclean all"; - prerr_endline "\tmatitaclean (uri|file)+"; + prerr_endline "\t\tcleans the whole environment"; + prerr_endline "\tmatitaclean files..."; + prerr_endline "\t\tcleans the output of the compilation of files...\n"; prerr_endline ""; exit 1 @@ -20,7 +22,7 @@ let _ = if Array.length Sys.argv < 2 then usage (); if Sys.argv.(1) = "all" then begin - MatitaDb.reset_owner_environment (); + MatitaDb.clean_owner_environment (); exit 0 end let uri_to_remove =ref [] in -- 2.39.2