1 let _ = Helm_registry.load_from "extractor.conf.xml"
6 !! This binary should not be called by hand, use the extractor_manager. !!
8 usage: ./extractor[.opt] path owner
10 path: the path for the getter maps
11 owner: the owner of the tables to update
17 let _ = Sys.argv.(2), Sys.argv.(1) in
18 if Sys.argv.(1) = "-h"||Sys.argv.(1) = "-help"||Sys.argv.(1) = "--help" then
24 Invalid_argument _ -> usage (); exit 1
26 let owner = Sys.argv.(2)
27 let path = Sys.argv.(1)
30 print_endline (Printf.sprintf "%d alive on path:%s owner:%s"
31 (Unix.getpid()) path owner);
32 Helm_registry.load_from "extractor.conf.xml";
33 Helm_registry.set "tmp.dir" path;
35 let dbspec = LibraryDb.parse_dbd_conf () in
36 let dbd = HSql.quick_connect dbspec in
37 MetadataTypes.ownerize_tables owner;
39 let ic = open_in (path ^ "/todo") in
43 let l = input_line ic in
51 let len = float_of_int (List.length uris) in
56 let perc = ((float_of_int !i) /. len *. 100.0) in
57 let l = String.length u in
60 u ^ String.make (magic + 3 - l) ' '
62 "..." ^ String.sub u (l - magic) magic
64 Printf.printf "%d (%d of %.0f = %3.1f%%): %s\n"
65 (Unix.getpid ()) !i len perc short;
67 let uri = UriManager.uri_of_string u in
68 MetadataDb.index_obj ~dbd ~uri;
69 CicEnvironment.empty ())
71 print_string "END "; Unix.system "date"