- let rec fix acc l =
- let acc, todo =
- List.fold_left (fun (acc,todo) x ->
- let w = who_uses x in
- if w = [] then (x::acc,todo) else (acc,uniq (todo@w)))
- (acc,[]) l
- in
- if todo = [] then uniq acc else fix acc todo
- in
- (fix [] alluris)
+ if not rank_all_dependencies then
+ alluris
+ else (
+ let dbd = HSql.quick_connect (LibraryDb.parse_dbd_conf ()) in
+ MetadataTypes.ownerize_tables (Helm_registry.get "matita.owner");
+ let uniq l =
+ HExtlib.list_uniq (List.sort UriManager.compare l) in
+ let who_uses u =
+ uniq (List.map (fun (uri,_) -> UriManager.strip_xpointer uri)
+ (MetadataDeps.inverse_deps ~dbd u)) in
+ let rec fix acc l =
+ let acc, todo =
+ List.fold_left (fun (acc,todo) x ->
+ let w = who_uses x in
+ if w = [] then (x::acc,todo) else (acc,uniq (todo@w)))
+ (acc,[]) l
+ in
+ if todo = [] then uniq acc else fix acc todo
+ in
+ fix [] alluris)