-if Sys.argv.(1) = "clean" then
- MetadataDb.clean ~dbh ~owner
-else
- let uri_str = Sys.argv.(1) in
- let uri = UriManager.uri_of_string uri_str in
- match CicEnvironment.get_obj uri with
- | Cic.Constant (_, body, ty, _) ->
- MetadataDb.index_constant ~body ~ty ~uri ~owner ~dbh
- | Cic.InductiveDefinition (types, _, _) ->
- MetadataDb.index_inductive_def ~dbh ~owner ~uri ~types
- | _ -> assert false
+let _ = MetadataTypes.ownerize_tables owner in
+if Sys.argv.(1) = "clean" then begin
+ prerr_endline "foo";
+ ignore (MetadataDb.clean ~dbd)
+end else
+ let fname = Sys.argv.(1) in
+ let n = ref 0 in
+ let ic = open_in fname in
+ try
+ while true do
+ let line = input_line ic in
+ incr n;
+ Printf.printf "%d\t%s\n" !n line; flush stdout;
+ let uri = UriManager.uri_of_string line in
+ MetadataDb.index_obj ~dbd ~uri
+ done
+ with
+ | _ ->
+ prerr_endline
+ ("total persing time " ^
+ (string_of_float !CicEnvironment.total_parsing_time));
+ close_in ic