[Pkg-ocaml-maint-commits] [approx] 04/08: add $curl_path configuration parameter

Eric Cooper ecc at cmu.edu
Sat Jun 20 17:51:27 UTC 2015


This is an automated email from the git hooks/post-receive script.

ecc-guest pushed a commit to branch upstream
in repository approx.

commit 38422ed8576a9f5cbe38908c6a4cda6148a4f8a9
Author: Mark White <mark at celos.net>
Date:   Fri Feb 28 22:14:59 2014 +0000

    add $curl_path configuration parameter
---
 config.ml         | 3 +++
 config.mli        | 1 +
 doc/approx.conf.5 | 3 +++
 etc/approx.conf   | 1 +
 url.ml            | 4 ++--
 5 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/config.ml b/config.ml
index 2681dd0..29dff27 100644
--- a/config.ml
+++ b/config.ml
@@ -89,6 +89,9 @@ let params = ("$offline", string_of_bool offline) :: params
 let max_wait = get_int "$max_wait" ~default: 10 (* seconds *)
 let params = ("$max_wait", string_of_int max_wait) :: params
 
+let curl_path = get "$curl_path" ~default: "/usr/bin/curl"
+let params = ("$curl_path", curl_path) :: params
+
 let debug = get_bool "$debug" ~default: false
 let params = ("$debug", string_of_bool debug) :: params
 
diff --git a/config.mli b/config.mli
index 7a66efd..7995f17 100644
--- a/config.mli
+++ b/config.mli
@@ -16,6 +16,7 @@ val syslog : string
 val pdiffs : bool
 val offline : bool
 val max_wait : int (* seconds *)
+val curl_path : string
 val verbose : bool
 val debug : bool
 
diff --git a/doc/approx.conf.5 b/doc/approx.conf.5
index e294c93..fa39033 100644
--- a/doc/approx.conf.5
+++ b/doc/approx.conf.5
@@ -59,6 +59,9 @@ Specifies how many seconds an
 .BR approx (8)
 process will wait for a concurrent download of a file to complete,
 before attempting to download the file itself (default: 10)
+.IP $curl_path
+Specifies the path to the curl binary (default:
+.IR /usr/bin/curl )
 .IP $verbose
 Specifies whether informational messages should be printed in the log
 (default:
diff --git a/etc/approx.conf b/etc/approx.conf
index 7797f41..cac1de6 100644
--- a/etc/approx.conf
+++ b/etc/approx.conf
@@ -18,5 +18,6 @@
 #$pdiffs	true
 #$offline	false
 #$max_wait	10
+#$curl_path	/usr/bin/curl
 #$verbose	false
 #$debug		false
diff --git a/url.ml b/url.ml
index c2d2da6..55574c1 100644
--- a/url.ml
+++ b/url.ml
@@ -56,8 +56,8 @@ let rate_option =
 
 let curl_command options url =
   Printf.sprintf
-    "/usr/bin/curl --fail --silent --header \"Pragma: no-cache\" %s %s %s"
-    rate_option (String.concat " " options) (quoted_string url)
+    "%s --fail --silent --header \"Pragma: no-cache\" %s %s %s"
+    curl_path rate_option (String.concat " " options) (quoted_string url)
 
 let head_command = curl_command ["--head"]
 

-- 
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