1 (***********************************************************************)
4 (* Nicolas Pouillard, Berke Durak, projet Gallium, INRIA Rocquencourt *)
6 (* Copyright 2007 Institut National de Recherche en Informatique et *)
7 (* en Automatique. All rights reserved. This file is distributed *)
8 (* under the terms of the Q Public License version 1.0. *)
10 (***********************************************************************)
12 (* Original author: Nicolas Pouillard *)
15 open Pathname.Operators
17 let digests = Hashtbl.create 103
19 let get = Hashtbl.find digests
21 let put = Hashtbl.replace digests
23 let _digests = lazy (Pathname.pwd / !Options.build_dir / (Pathname.mk "_digests"))
26 with_output_file !*_digests begin fun oc ->
27 Hashtbl.iter begin fun name digest ->
28 Printf.fprintf oc "%S: %S\n" name digest
33 Shell.chdir !Options.build_dir;
34 if Pathname.exists !*_digests then
35 with_input_file !*_digests begin fun ic ->
37 let l = input_line ic in
38 Scanf.sscanf l "%S: %S" put
39 done with End_of_file -> ()
41 My_unix.at_exit_once finalize