aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorletouzey2009-03-27 20:14:55 +0000
committerletouzey2009-03-27 20:14:55 +0000
commitfde2d235ea34a249aa13cd179eee255fed3a224f (patch)
tree90dd3649f3f33bb354afb3e912797123f1e30f56
parent7f2c52bcf588abfcbf30530bae240244229304a4 (diff)
Coqdep: some dead code and code move (first experiment with Oug)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12025 85f007b7-540e-0410-9357-904b9bb8a0f7
-rw-r--r--tools/coqdep.ml23
-rw-r--r--tools/coqdep_common.ml35
2 files changed, 23 insertions, 35 deletions
diff --git a/tools/coqdep.ml b/tools/coqdep.ml
index f6acd0b650..5faedf6828 100644
--- a/tools/coqdep.ml
+++ b/tools/coqdep.ml
@@ -22,6 +22,29 @@ let option_D = ref false
let option_w = ref false
let option_sort = ref false
+let rec warning_mult suf iter =
+ let tab = Hashtbl.create 151 in
+ let check f d =
+ begin try
+ let d' = Hashtbl.find tab f in
+ if (Filename.dirname (file_name f d))
+ <> (Filename.dirname (file_name f d')) then begin
+ eprintf "*** Warning : the file %s is defined twice!\n" (f ^ suf);
+ flush stderr
+ end
+ with Not_found -> () end;
+ Hashtbl.add tab f d
+ in
+ iter check
+
+let add_coqlib_known phys_dir log_dir f =
+ match get_extension f [".vo"] with
+ | (basename,".vo") ->
+ let name = log_dir@[basename] in
+ Hashtbl.add coqlibKnown [basename] ();
+ Hashtbl.add coqlibKnown name ()
+ | _ -> ()
+
let sort () =
let seen = Hashtbl.create 97 in
let rec loop file =
diff --git a/tools/coqdep_common.ml b/tools/coqdep_common.ml
index 7ac57a4f59..43395b0e9d 100644
--- a/tools/coqdep_common.ml
+++ b/tools/coqdep_common.ml
@@ -37,12 +37,6 @@ type dir = string option
let (//) s1 s2 =
if !option_slash then s1^"/"^s2 else Filename.concat s1 s2
-let (/) = Filename.concat
-
-let file_concat l =
- if l=[] then "<empty>" else
- List.fold_left (//) (List.hd l) (List.tl l)
-
(** [get_extension f l] checks whether [f] has one of the extensions
listed in [l]. It returns [f] without its extension, alongside with
the extension. When no extension match, [(f,"")] is returned *)
@@ -223,11 +217,6 @@ let traite_fichier_mllib md ext =
(!a_faire, !a_faire_opt)
with Sys_error _ -> ("","")
-let cut_prefix p s =
- let lp = String.length p in
- let ls = String.length s in
- if ls >= lp && String.sub s 0 lp = p then String.sub s lp (ls - lp) else s
-
let canonize f =
let f' = absolute_dir (Filename.dirname f) // Filename.basename f in
match List.filter (fun (_,full) -> f' = full) !vAccu with
@@ -342,30 +331,6 @@ let coq_dependencies () =
flush stdout)
(List.rev !vAccu)
-let rec warning_mult suf iter =
- let tab = Hashtbl.create 151 in
- let check f d =
- begin try
- let d' = Hashtbl.find tab f in
- if (Filename.dirname (file_name f d))
- <> (Filename.dirname (file_name f d')) then begin
- eprintf "*** Warning : the file %s is defined twice!\n" (f ^ suf);
- flush stderr
- end
- with Not_found -> () end;
- Hashtbl.add tab f d
- in
- iter check
-
-let add_coqlib_known phys_dir log_dir f =
- match get_extension f [".vo"] with
- | (basename,".vo") ->
- let name = log_dir@[basename] in
- Hashtbl.add coqlibKnown [basename] ();
- Hashtbl.add coqlibKnown name ()
- | _ -> ()
-
-
let add_known phys_dir log_dir f =
match get_extension f [".v";".ml";".mli";".ml4";".mllib"] with
| (basename,".v") ->