[Pkg-ocaml-maint-commits] r4856 - in /trunk/projects/approx: build-area/ trunk/approx.ml trunk/debian/NEWS trunk/debian/changelog trunk/debian/copyright trunk/default_config.ml trunk/default_config.mli trunk/doc/approx.conf.5 trunk/doc/gc_approx.8 trunk/doc/update_approx.8
ecc-guest at users.alioth.debian.org
ecc-guest at users.alioth.debian.org
Tue Dec 4 17:47:47 UTC 2007
Author: ecc-guest
Date: Tue Dec 4 17:47:47 2007
New Revision: 4856
URL: http://svn.debian.org/wsvn/?sc=1&rev=4856
Log:
add $offline configuration parameter
improve man pages
Modified:
trunk/projects/approx/build-area/ (props changed)
trunk/projects/approx/trunk/approx.ml
trunk/projects/approx/trunk/debian/NEWS
trunk/projects/approx/trunk/debian/changelog
trunk/projects/approx/trunk/debian/copyright
trunk/projects/approx/trunk/default_config.ml
trunk/projects/approx/trunk/default_config.mli
trunk/projects/approx/trunk/doc/approx.conf.5
trunk/projects/approx/trunk/doc/gc_approx.8
trunk/projects/approx/trunk/doc/update_approx.8
Propchange: trunk/projects/approx/build-area/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Dec 4 17:47:47 2007
@@ -1,0 +1,1 @@
+*
Modified: trunk/projects/approx/trunk/approx.ml
URL: http://svn.debian.org/wsvn/trunk/projects/approx/trunk/approx.ml?rev=4856&op=diff
==============================================================================
--- trunk/projects/approx/trunk/approx.ml (original)
+++ trunk/projects/approx/trunk/approx.ml Tue Dec 4 17:47:47 2007
@@ -376,6 +376,11 @@
let respond code =
raise (Nethttpd_types.Standard_response (code, None, None))
in
+ let copy_if_newer () =
+ (* deliver the the cached copy if it is newer than the client's *)
+ if mod_time > ims then copy_from_cache name cgi
+ else respond `Not_modified
+ in
let status = download_url url name (max ims mod_time) cgi in
if verbose then info_message "%s: %s" url (string_of_download_status status);
match status with
@@ -386,12 +391,10 @@
copy_from_cache name cgi;
cleanup_after url name
| Not_modified ->
- if mod_time > ims then (* the cached copy is newer than the client's *)
- copy_from_cache name cgi
- else
- respond `Not_modified
+ copy_if_newer ()
| File_not_found ->
- respond `Not_found
+ if offline && Sys.file_exists name then copy_if_newer ()
+ else respond `Not_found
let remote_service url name ims mod_time =
object
Modified: trunk/projects/approx/trunk/debian/NEWS
URL: http://svn.debian.org/wsvn/trunk/projects/approx/trunk/debian/NEWS?rev=4856&op=diff
==============================================================================
--- trunk/projects/approx/trunk/debian/NEWS (original)
+++ trunk/projects/approx/trunk/debian/NEWS Tue Dec 4 17:47:47 2007
@@ -19,8 +19,12 @@
is requested, and all other index files in the cache are validated
against the Release file.
- -- Eric Cooper <ecc at cmu.edu> Sat, 24 Nov 2007 20:30:00 -0500
+ A new configuration parameter, $offline, causes the approx server
+ to deliver (possibly out-of-date) cached files when they cannot be
+ downloaded from remote repositories.
+ -- Eric Cooper <ecc at cmu.edu> Tue, 04 Dec 2007 12:24:16 -0500
+
approx (2.9.0) unstable; urgency=low
Configuration parameters in /etc/approx/approx.conf should now begin
Modified: trunk/projects/approx/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/trunk/projects/approx/trunk/debian/changelog?rev=4856&op=diff
==============================================================================
--- trunk/projects/approx/trunk/debian/changelog (original)
+++ trunk/projects/approx/trunk/debian/changelog Tue Dec 4 17:47:47 2007
@@ -2,9 +2,10 @@
* Support pdiffs (closes: #405535)
* Create temp files in approx cache rather than TMPDIR (closes: #451768)
- * Changed debian/control and Makefile to use ocamlnet2 (>= 2.2.8)
-
- -- Eric Cooper <ecc at cmu.edu> Sat, 24 Nov 2007 20:30:00 -0500
+ * Added $offline parameter to control delivery of cached files
+ when remote downloads fail (closes: #442801)
+
+ -- Eric Cooper <ecc at cmu.edu> Tue, 04 Dec 2007 12:24:16 -0500
approx (2.9.1) unstable; urgency=low
Modified: trunk/projects/approx/trunk/debian/copyright
URL: http://svn.debian.org/wsvn/trunk/projects/approx/trunk/debian/copyright?rev=4856&op=diff
==============================================================================
--- trunk/projects/approx/trunk/debian/copyright (original)
+++ trunk/projects/approx/trunk/debian/copyright Tue Dec 4 17:47:47 2007
@@ -12,9 +12,9 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+You should have received a copy of the GNU General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-On Debian GNU/Linux systems, the complete text of the GNU General
-Public License can be found in /usr/share/common-licenses/GPL.
+On Debian GNU/Linux systems, the complete text of version 2 of the
+GNU General Public License can be found in /usr/share/common-licenses/GPL-2.
Modified: trunk/projects/approx/trunk/default_config.ml
URL: http://svn.debian.org/wsvn/trunk/projects/approx/trunk/default_config.ml?rev=4856&op=diff
==============================================================================
--- trunk/projects/approx/trunk/default_config.ml (original)
+++ trunk/projects/approx/trunk/default_config.ml Tue Dec 4 17:47:47 2007
@@ -11,12 +11,16 @@
let interface = get "$interface" ~default: "any"
let port = get_int "$port" ~default: 9999 (* compatible with apt-proxy *)
-let max_wait = get_int "$max_wait" ~default: 10 (* seconds *)
let max_rate = get "$max_rate" ~default: "unlimited"
+
let user = get "$user" ~default: "approx"
let group = get "$group" ~default: "approx"
let syslog = get "$syslog" ~default: "daemon"
+
let pdiffs = get_bool "$pdiffs" ~default: true
+let offline = get_bool "$offline" ~default: false
+let max_wait = get_int "$max_wait" ~default: 10 (* seconds *)
+
let debug = get_bool "$debug" ~default: false
let verbose = get_bool "$verbose" ~default: false || debug
@@ -24,11 +28,12 @@
let pf fmt = Printf.ksprintf f fmt in
pf "Interface: %s" interface;
pf "Port: %d" port;
- pf "Max wait: %d" max_wait;
pf "Max rate: %s" max_rate;
pf "User: %s" user;
pf "Group: %s" group;
pf "Syslog: %s" syslog;
pf "Pdiffs: %B" pdiffs;
+ pf "Offline: %B" offline;
+ pf "Max wait: %d" max_wait;
pf "Verbose: %B" verbose;
pf "Debug: %B" debug
Modified: trunk/projects/approx/trunk/default_config.mli
URL: http://svn.debian.org/wsvn/trunk/projects/approx/trunk/default_config.mli?rev=4856&op=diff
==============================================================================
--- trunk/projects/approx/trunk/default_config.mli (original)
+++ trunk/projects/approx/trunk/default_config.mli Tue Dec 4 17:47:47 2007
@@ -7,12 +7,16 @@
val interface : string
val port : int
-val max_wait : int (* seconds *)
val max_rate : string (* bytes/second with optional K, M, or G suffix *)
+
val user : string
val group : string
val syslog : string
+
val pdiffs : bool
+val offline : bool
+val max_wait : int (* seconds *)
+
val verbose : bool
val debug : bool
Modified: trunk/projects/approx/trunk/doc/approx.conf.5
URL: http://svn.debian.org/wsvn/trunk/projects/approx/trunk/doc/approx.conf.5?rev=4856&op=diff
==============================================================================
--- trunk/projects/approx/trunk/doc/approx.conf.5 (original)
+++ trunk/projects/approx/trunk/doc/approx.conf.5 Tue Dec 4 17:47:47 2007
@@ -28,11 +28,6 @@
Specifies the TCP port on which the
.BR approx (8)
server listens for HTTP requests (default: 9999)
-.IP $max_wait
-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 $max_rate
Specifies the maximum download rate from remote repositories,
in bytes per second (default: unlimited).
@@ -49,6 +44,16 @@
Specifies whether to support IndexFile diffs
(default:
.BR true )
+.IP $offline
+Specifies whether to deliver (possibly out-of-date) cached files when
+they cannot be downloaded from remote repositories
+(default:
+.BR false )
+.IP $max_wait
+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 $verbose
Specifies whether informational messages should be printed in the log
(default:
Modified: trunk/projects/approx/trunk/doc/gc_approx.8
URL: http://svn.debian.org/wsvn/trunk/projects/approx/trunk/doc/gc_approx.8?rev=4856&op=diff
==============================================================================
--- trunk/projects/approx/trunk/doc/gc_approx.8 (original)
+++ trunk/projects/approx/trunk/doc/gc_approx.8 Tue Dec 4 17:47:47 2007
@@ -54,18 +54,19 @@
\`=\' for incorrect size, \`!\' for incorrect checksum, blank for unneeded.
.SH EXAMPLES
+.PP
+To remove all unneeded or corrupted files from the cache:
.IP
gc_approx \-\^\-quiet
.PP
-removes all unneeded or corrupted files from the cache.
This is run as a weekly
.BR cron (8)
job.
+.PP
+To list the files that would be removed from the cache,
+without actually doing so:
.IP
gc_approx \-\^\-keep
-.PP
-lists the files that would be removed from the cache,
-without actually doing so.
.SH FILES
.TP
Modified: trunk/projects/approx/trunk/doc/update_approx.8
URL: http://svn.debian.org/wsvn/trunk/projects/approx/trunk/doc/update_approx.8?rev=4856&op=diff
==============================================================================
--- trunk/projects/approx/trunk/doc/update_approx.8 (original)
+++ trunk/projects/approx/trunk/doc/update_approx.8 Tue Dec 4 17:47:47 2007
@@ -18,18 +18,34 @@
.B update_approx
updates the Packages and Sources files in the
.BR approx (8)
-cache by applying diffs.
+cache by downloading and applying pdiffs.
.SH OPTIONS
.TP
.BR \-k ", " \-\^\-keep ", " \-s ", " \-\^\-simulate
-Don't update index files or remove files from the cache.
+Don't download, update, or remove any files in the cache.
.TP
.BR \-q ", " \-\^\-quiet
Don't print information about status, updates, or removals.
.TP
.BR \-v ", " \-\^\-verbose
-Print status of each index file.
+Print the status of each Packages or Sources file.
+
+.SH EXAMPLES
+.PP
+To download and apply any pdiffs necessary to bring
+the Packages and Sources files in the cache up to date:
+.IP
+update_approx \-\^\-quiet
+.PP
+This is run as a daily
+.BR cron (8)
+job.
+.PP
+To show the status of each Packages and Sources file in the cache
+(whether it is up-to-date according to the corresponding Release file):
+.IP
+update_approx \-\^\-keep \-\^\-verbose
.SH FILES
.TP
More information about the Pkg-ocaml-maint-commits
mailing list