[Pkg-ocaml-maint-commits] r2935 - in /trunk/packages/mldonkey/trunk/debian: changelog patches/00list patches/04_cfs.dpatch

smimram at users.alioth.debian.org smimram at users.alioth.debian.org
Thu Jul 13 13:42:33 UTC 2006


Author: smimram
Date: Thu Jul 13 13:42:31 2006
New Revision: 2935

URL: http://svn.debian.org/wsvn/pkg-ocaml-maint/?sc=1&rev=2935
Log:
Handle CFS filesystems.

Added:
    trunk/packages/mldonkey/trunk/debian/patches/04_cfs.dpatch   (with props)
Modified:
    trunk/packages/mldonkey/trunk/debian/changelog
    trunk/packages/mldonkey/trunk/debian/patches/00list

Modified: trunk/packages/mldonkey/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-ocaml-maint/trunk/packages/mldonkey/trunk/debian/changelog?rev=2935&op=diff
==============================================================================
--- trunk/packages/mldonkey/trunk/debian/changelog (original)
+++ trunk/packages/mldonkey/trunk/debian/changelog Thu Jul 13 13:42:31 2006
@@ -6,6 +6,8 @@
       MLDONKEY_USER. This variable is only used by the init script.
     - Mke the initscript create /var/run/mldonkey-server, setting correct
       owner and permissions.
+  * Added 04_cfs.dpatch (thanks spiralvoice) to handle CFS filesystems which
+    incorrectly report freespace, closes: #377865.
 
  -- Samuel Mimram <smimram at debian.org>  Thu, 13 Jul 2006 12:49:45 +0000
 

Modified: trunk/packages/mldonkey/trunk/debian/patches/00list
URL: http://svn.debian.org/wsvn/pkg-ocaml-maint/trunk/packages/mldonkey/trunk/debian/patches/00list?rev=2935&op=diff
==============================================================================
--- trunk/packages/mldonkey/trunk/debian/patches/00list (original)
+++ trunk/packages/mldonkey/trunk/debian/patches/00list Thu Jul 13 13:42:31 2006
@@ -1,3 +1,4 @@
 01_see
 02_usr_bin
 03_lock_config_files_space
+04_cfs

Added: trunk/packages/mldonkey/trunk/debian/patches/04_cfs.dpatch
URL: http://svn.debian.org/wsvn/pkg-ocaml-maint/trunk/packages/mldonkey/trunk/debian/patches/04_cfs.dpatch?rev=2935&op=file
==============================================================================
--- trunk/packages/mldonkey/trunk/debian/patches/04_cfs.dpatch (added)
+++ trunk/packages/mldonkey/trunk/debian/patches/04_cfs.dpatch Thu Jul 13 13:42:31 2006
@@ -1,0 +1,47 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 04_cfs.dpatch by spiralvoice <spiralvoice at hotmail.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Handle CFS filesystems which incorrectly report free space.
+## DP: See #377865.
+
+ at DPATCH@
+diff -urNad mldonkey-2.7.7~/src/daemon/driver/driverInteractive.ml mldonkey-2.7.7/src/daemon/driver/driverInteractive.ml
+--- mldonkey-2.7.7~/src/daemon/driver/driverInteractive.ml	2006-06-19 20:26:08.000000000 +0000
++++ mldonkey-2.7.7/src/daemon/driver/driverInteractive.ml	2006-07-13 13:37:37.000000000 +0000
+@@ -93,6 +93,7 @@
+   let dir_full dir mb =
+     match Unix32.diskfree dir with
+     | None -> false
++    | Some v when ((Unix32.filesystem dir = "NFS_SUPER_MAGIC") && v = zero) -> false
+     | Some v -> v < megabytes mb
+   in
+ 
+diff -urNad mldonkey-2.7.7~/src/utils/lib/unix32.ml mldonkey-2.7.7/src/utils/lib/unix32.ml
+--- mldonkey-2.7.7~/src/utils/lib/unix32.ml	2006-05-25 19:47:25.000000000 +0000
++++ mldonkey-2.7.7/src/utils/lib/unix32.ml	2006-07-13 13:37:37.000000000 +0000
+@@ -1794,14 +1794,22 @@
+ (* percentage of used disk space *)
+   match diskfree dir, disktotal dir with
+   | Some dfree, Some dtotal ->
+-      Some (Int64.to_int (100L -- (dfree ** 100L // dtotal)))
++      begin
++	try
++	  Some (Int64.to_int (100L -- (dfree ** 100L // dtotal)))
++        with Division_by_zero -> None
++      end
+   | _ -> None
+ 
+ let percentfree dir =
+ (* percentage of free disk space *)
+   match diskfree dir, disktotal dir with
+   | Some dfree, Some dtotal ->
+-      Some (Int64.to_int (dfree ** 100L // dtotal))
++      begin
++	try
++          Some (Int64.to_int (dfree ** 100L // dtotal))
++	with Division_by_zero -> None
++      end
+   | _ -> None
+ 
+ let filesystem dir =

Propchange: trunk/packages/mldonkey/trunk/debian/patches/04_cfs.dpatch
------------------------------------------------------------------------------
    svn:executable = *




More information about the Pkg-ocaml-maint-commits mailing list