Preliminary support for cross-domain references
git-svn-id: file:///srv/svn/repo/kosuzu/trunk@42 eb64cd80-c68d-6f47-b6a3-0ada418499da
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
let text_dir = Filename.concat (File_store.txtdir ()) "peers"
|
||||
|
||||
type t = { path: string; locations: string list }
|
||||
type t = { path: string; pack: Header_pack.t }
|
||||
|
||||
let fold fn init = match Sys.readdir text_dir with
|
||||
| exception (Sys_error msg) -> prerr_endline msg; init
|
||||
@@ -13,7 +13,7 @@ let fold fn init = match Sys.readdir text_dir with
|
||||
| false -> Printf.eprintf "Missing index.pck for %s\n" path; init
|
||||
| true -> match Header_pack.of_string (File_store.to_string pack_path) with
|
||||
| Error s -> Printf.eprintf "%s %s\n" s pack_path; init
|
||||
| Ok p -> fn init { path; locations = Header_pack.(p.info.locations) }
|
||||
| Ok pack -> fn init { path; pack }
|
||||
end else init
|
||||
in
|
||||
Array.fold_left read_pack init dirs
|
||||
|
||||
Reference in New Issue
Block a user