From 2afb20c90f56b970887c650c35fb9043ccc4c2dc Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Thu, 7 Jul 2005 09:54:49 +0000 Subject: [PATCH] matitaclean now removes the .moo file, if existent. --- helm/matita/library/Makefile | 1 - helm/matita/matitaclean.ml | 15 ++++++++++----- helm/matita/tests/Makefile | 1 - 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/helm/matita/library/Makefile b/helm/matita/library/Makefile index f1770a657..116fc8244 100644 --- a/helm/matita/library/Makefile +++ b/helm/matita/library/Makefile @@ -31,7 +31,6 @@ verboseopt: $(H)make MATITAC="$(MATITACOPT)" MATITACLEAN="$(MATITACLEANOPT)" MATITADEP="$(MATITADEPOPT)" $(@:%.opt=%) clean: $(LINKS) - $(H)rm -f $(SRC:%.ma=%.moo) $(H)$(MATITACLEAN) $(SRC) cleanall: $(LINKS) diff --git a/helm/matita/matitaclean.ml b/helm/matita/matitaclean.ml index ab3e2a732..60866fc1a 100644 --- a/helm/matita/matitaclean.ml +++ b/helm/matita/matitaclean.ml @@ -26,7 +26,8 @@ let _ = MatitaDb.clean_owner_environment (); exit 0 end - let uri_to_remove =ref [] in + let uris_to_remove =ref [] in + let files_to_remove =ref [] in (try for i = 1 to Array.length Sys.argv - 1 do let suri = Sys.argv.(i) in @@ -34,11 +35,15 @@ let _ = try UM.buri_of_uri (UM.uri_of_string suri) with - UM.IllFormedUri _ -> MatitacleanLib.baseuri_of_file suri + UM.IllFormedUri _ -> + files_to_remove := suri :: !files_to_remove; + MatitacleanLib.baseuri_of_file suri in - uri_to_remove := uri :: !uri_to_remove + uris_to_remove := uri :: !uris_to_remove done with Invalid_argument _ -> usage ()); - main !uri_to_remove - + 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 diff --git a/helm/matita/tests/Makefile b/helm/matita/tests/Makefile index 79bbf3e39..253a63d4c 100644 --- a/helm/matita/tests/Makefile +++ b/helm/matita/tests/Makefile @@ -31,7 +31,6 @@ verboseopt: $(H)make MATITAC="$(MATITACOPT)" MATITACLEAN="$(MATITACLEANOPT)" MATITADEP="$(MATITADEPOPT)" $(@:%.opt=%) clean: $(LINKS) - $(H)rm -f $(SRC:%.ma=%.moo) $(H)$(MATITACLEAN) $(SRC) cleanall: $(LINKS) -- 2.39.2