-
-let decompile ~baseuri =
- let baseuris = get_deps baseuri in
- List.iter (fun baseuri ->
- remove_deps baseuri;
- HExtlib.safe_remove (ng_path_of_baseuri baseuri);
- let basepath = ng_path_of_baseuri ~no_suffix:true baseuri in
- try
- let od = Unix.opendir basepath in
- let rec aux names =
- try
- let name = Unix.readdir od in
- if name <> "." && name <> ".." then aux (name::names) else aux names
- with
- End_of_file -> names in
- let names = List.map (fun name -> basepath ^ "/" ^ name) (aux []) in
- Unix.closedir od;
- List.iter Unix.unlink names;
- HExtlib.rmdir_descend basepath;
- set_global_aliases
- (List.filter
- (fun (_,_,NReference.Ref (nuri,_)) ->
- Filename.dirname (NUri.string_of_uri nuri) <> NUri.string_of_uri baseuri
- ) (get_global_aliases ()))
- with
- Unix.Unix_error _ -> () (* raised by Unix.opendir, we hope :-) *)
- ) baseuris
-;;
-
-LibraryClean.set_decompile_cb
- (fun ~baseuri -> decompile ~baseuri:(NUri.uri_of_string baseuri));;
-
-let fetch_obj uri =