* Copyright (C) 2005, Stefano Zacchiroli <zack@debian.org>
*
* Created: Wed, 06 Apr 2005 16:55:39 +0200 zack
- * Last-Modified: Sat, 09 Jul 2005 17:40:44 +0200 zack
+ * Last-Modified: Sat, 09 Jul 2005 18:43:03 +0200 zack
*
* This is free software, you can redistribute it and/or modify it under the
* terms of the GNU General Public License version 2 as published by the Free
let update () =
info (sprintf "updating registry %s using info from %s/"
registry_file md5sums_dir);
- let registry = open_out registry_file in
let keys = Hashtbl.create 1024 in (* history of seen registry keys *)
let dir = Unix.opendir md5sums_dir in
+ let registry = open_out registry_file in
try
while true do
let fname = sprintf "%s/%s" md5sums_dir (Unix.readdir dir) in
with End_of_file ->
Unix.closedir dir;
close_out registry;
- if is_empty registry_file then Sys.remove registry_file
+ if is_empty registry_file then begin
+ Sys.remove registry_file;
+ ignore (Sys.command ("/bin/rmdir -p " ^ md5sums_dir))
+ end
(** {2 Main} *)