[Pkg-ocaml-maint-commits] [approx] 07/16: download index if needed to apply pdiffs
Eric Cooper
ecc at cmu.edu
Mon Dec 9 15:44:03 UTC 2013
This is an automated email from the git hooks/post-receive script.
ecc-guest pushed a commit to branch upstream
in repository approx.
commit 7ee9bdf14fc088570d12ec84ef3d3466b329edb5
Author: Eric Cooper <ecc at cmu.edu>
Date: Mon Apr 22 13:32:58 2013 -0400
download index if needed to apply pdiffs
---
pdiff.ml | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/pdiff.ml b/pdiff.ml
index d9078a3..aa1f7a4 100644
--- a/pdiff.ml
+++ b/pdiff.ml
@@ -1,5 +1,5 @@
(* approx: proxy server for Debian archive files
- Copyright (C) 2011 Eric C. Cooper <ecc at cmu.edu>
+ Copyright (C) 2013 Eric C. Cooper <ecc at cmu.edu>
Released under the GNU General Public License *)
open Config
@@ -83,6 +83,8 @@ let update index =
info_message "Updating %s" index;
if not (Filename.check_suffix index ".gz") then
invalid_string_arg "Pdiff.update" index;
+ if not (Sys.file_exists index) then
+ Url.download_file index;
let dir = Filename.chop_suffix index ".gz" ^ ".diff" in
let diffs, final = read_diff_index dir in
let update_index file =
@@ -90,7 +92,7 @@ let update index =
if info = final then debug_message "%s is current" index
else
match find_tail (fun (i, _, _) -> i = info) diffs with
- | [] -> debug_message "%s not found in DiffIndex" index; raise Not_found
+ | [] -> failwith (index ^ " not found in DiffIndex")
| list -> apply_pdiffs file list final index
in
decompress_and_apply update_index index
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ocaml-maint/packages/approx.git
More information about the Pkg-ocaml-maint-commits
mailing list