- let deps = ma_file :: deps in
- let deps =
- List.map (fun f ->
- let f =
- if Pcre.pmatch ~pat:"^\\./" f then
- String.sub f 2 (String.length f - 2)
- else
- f
- in HExtlib.normalize_path f) deps
- in
- output_string oc (String.concat " " deps ^ "\n"))
- ma_files;
- close_out oc;
- HLog.message ("Generated " ^ Sys.getcwd () ^ "/depends")
+ let deps = List.map fix_name deps in
+ (fix_name ma_file, deps) :: acc)
+ [] ma_files
+ in
+ let extern =
+ List.fold_left
+ (fun acc (_,d) ->
+ List.fold_left
+ (fun a x ->
+ if List.exists (fun (t,_) -> x=t) deps then a
+ else x::a)
+ acc d)
+ [] deps
+ in
+ Librarian.write_deps_file (Sys.getcwd()) (deps@List.map (fun x -> x,[]) extern)
+;;