[Pkg-ocaml-maint-commits] r2459 - in trunk/projects/approx/trunk: .
debian
Eric Cooper
ecc-guest at costa.debian.org
Sun Jan 8 19:31:10 UTC 2006
Author: ecc-guest
Date: 2006-01-08 19:31:10 +0000 (Sun, 08 Jan 2006)
New Revision: 2459
Modified:
trunk/projects/approx/trunk/Makefile
trunk/projects/approx/trunk/debian/changelog
trunk/projects/approx/trunk/debian/control
trunk/projects/approx/trunk/url.ml
Log:
missed one occurrence of curl in previous fix of url.ml
transition to OCaml 3.09.1
Modified: trunk/projects/approx/trunk/Makefile
===================================================================
--- trunk/projects/approx/trunk/Makefile 2006-01-08 18:48:41 UTC (rev 2458)
+++ trunk/projects/approx/trunk/Makefile 2006-01-08 19:31:10 UTC (rev 2459)
@@ -4,7 +4,7 @@
export OCAMLMAKEFILE = /usr/share/ocaml-tools/OCamlMakefile
-export OCAMLFLAGS = -w A
+export OCAMLFLAGS = -warn-error A
define PROJ_server
SOURCES = util.ml config.ml default_config.ml log.ml url.ml control_file.ml release.ml server.ml version.ml approx.ml
Modified: trunk/projects/approx/trunk/debian/changelog
===================================================================
--- trunk/projects/approx/trunk/debian/changelog 2006-01-08 18:48:41 UTC (rev 2458)
+++ trunk/projects/approx/trunk/debian/changelog 2006-01-08 19:31:10 UTC (rev 2459)
@@ -1,3 +1,10 @@
+approx (2.05) unstable; urgency=low
+
+ * Factor out all uses of curl command (missed one in previous fix)
+ * Transition to OCaml 3.09.1
+
+ -- Eric Cooper <ecc at cmu.edu> Sun, 8 Jan 2006 14:29:20 -0500
+
approx (2.04) unstable; urgency=low
* Added --location option to curl so that it will follow HTTP redirections
@@ -71,7 +78,7 @@
approx (1.16) unstable; urgency=low
- * Support concurrent requests
+ * Support concurrent requests
- use http_daemon's Fork mode
- rely on atomic rename of foo.tmp -> foo in cache
- detect concurrent downloads in progress and wait for them
Modified: trunk/projects/approx/trunk/debian/control
===================================================================
--- trunk/projects/approx/trunk/debian/control 2006-01-08 18:48:41 UTC (rev 2458)
+++ trunk/projects/approx/trunk/debian/control 2006-01-08 19:31:10 UTC (rev 2459)
@@ -3,7 +3,7 @@
Priority: optional
Maintainer: Eric Cooper <ecc at cmu.edu>
Uploaders: Sven Luther <luther at debian.org>, Stefano Zacchiroli <zack at debian.org>
-Build-Depends: debhelper (>= 5.0), ocaml-nox (>= 3.09.0), ocaml-best-compilers, ocaml-tools, libocamlnet-ocaml-dev (>= 1.1), libpcre-ocaml-dev (>= 5.10), libsyslog-ocaml-dev (>= 1.2)
+Build-Depends: debhelper (>= 5.0), ocaml-nox (>= 3.09.1), ocaml-best-compilers, ocaml-tools, libocamlnet-ocaml-dev (>= 1.1), libpcre-ocaml-dev (>= 5.10), libsyslog-ocaml-dev (>= 1.2)
Standards-Version: 3.6.2
Package: approx
Modified: trunk/projects/approx/trunk/url.ml
===================================================================
--- trunk/projects/approx/trunk/url.ml 2006-01-08 18:48:41 UTC (rev 2458)
+++ trunk/projects/approx/trunk/url.ml 2006-01-08 19:31:10 UTC (rev 2459)
@@ -7,9 +7,13 @@
open Log
open Printf
-let head_command url =
- sprintf "/usr/bin/curl --silent --head %s" (quoted_string url)
+let curl_command options url =
+ "/usr/bin/curl --silent --location " ^
+ String.concat " " options ^ " " ^
+ quoted_string url
+let head_command = curl_command ["--head"]
+
let iter_headers chan proc =
let next () =
try Some (input_line chan)
@@ -46,14 +50,12 @@
iter_headers chan callback;
finish (Unix.close_process_in chan)
-let download_command url headers headers_wanted =
- let add_header str h =
- sprintf "%s --header %s" str (quoted_string h)
+let download_command headers_wanted headers =
+ let options =
+ (if headers_wanted then ["--include"] else []) @
+ List.map (fun h -> "--header " ^ quoted_string h) headers
in
- sprintf "/usr/bin/curl --silent --location %s %s %s"
- (if headers_wanted then "--include" else "")
- (List.fold_left add_header "" headers)
- (quoted_string url)
+ curl_command options
let iter_body chan proc =
let len = 4096 in
@@ -66,7 +68,7 @@
loop ()
let download url ?(headers=[]) ?header_callback callback =
- let cmd = download_command url headers (header_callback <> None) in
+ let cmd = download_command (header_callback <> None) headers url in
if debug then debug_message "Command: %s" cmd;
let chan = Unix.open_process_in cmd in
(match header_callback with
More information about the Pkg-ocaml-maint-commits
mailing list