Commits

camlspotter  committed a4e8fca

find fix

  • Participants
  • Parent commits b08242c

Comments (0)

Files changed (1)

File spotinstall.ml

     | Package package -> OCamlFind.dest_dir package 
     | Path p -> p
   in
-  find [dest_dir] &~ fun path -> 
-    if path.base = "site-lib" && package = Package "ocaml" then 
-      prune ()
-    else match Filename.split_extension path.base with
+  Find.find [dest_dir] &~ fun path -> 
+    if path#base = "site-lib" && package = Package "ocaml" then 
+      Find.prune ()
+    else match Filename.split_extension path#base with
     | body, (".cmx" | ".cmo" | ".cmi" as ext) -> 
-        if verbose then Printf.eprintf "found %s\n" path.path;
-        Hashtbl.add tbl (body, ext) (package, path.path)
+        if verbose then Printf.eprintf "found %s\n" path#path;
+        Hashtbl.add tbl (body, ext) (package, path#path)
     | _ -> ()
 
 let dests = 
 
   eprintf "Traversing the current directory to find compiled files...\n%!";
 
-  find ["."] ~f:(fun path ->
-    match Filename.split_extension path.base with
+  Unix.Find.find ["."] ~f:(fun path ->
+    match Filename.split_extension path#base with
     | body, (".cmx" | ".cmo" | ".cmi" | ".ml" as ext) -> 
-        List.map (fun ext -> path.dir ^/ body ^ ext) (exts_of_sp ext)
+        List.map (fun ext -> path#dir ^/ body ^ ext) (exts_of_sp ext)
         |> List.find_all Sys.file_exists 
         |> List.iter (fun spotspit ->
           Hashtbl.find_all installed_cms (body, ext) 
           |> List.iter (fun (_package, p) -> 
-            match cmp p path.path with
+            match cmp p path#path with
             | `Different | `Error -> ()
             | `Same ->
                 (* The file is installed! If there is .spot/.spit, copy it! *)