--- pydf.orig  2009-04-10 13:00:07.000000000 +0000
+++ pydf       2009-07-15 12:54:08.000000000 +0000
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#! %%PYTHON_CMD%%

 import sys, os, string, types, commands, struct
 from optparse import OptionParser
@@ -169,8 +169,8 @@
 #end of default definitions

 # read configuration file
-for i in ["/etc/pydfrc", os.environ['HOME']+"/.pydfrc"]:
-    if os.path.isfile(i):
+for i in ["%%PREFIX%%/etc/pydfrc", os.environ['HOME']+"/.pydfrc"]:
+      if os.path.isfile(i):
         execfile(i)


@@ -344,9 +344,9 @@
         except OSError, IOError:
             status = 10*[0]

-        fs_blocksize = status[F_BSIZE]
+        fs_blocksize = status[F_FRSIZE]
         if fs_blocksize == 0:
-            fs_blocksize = status[F_FRSIZE]
+            fs_blocksize = status[F_BSIZE]
         free = status[F_BFREE]
         size = status[F_BLOCKS]
         avail = status[F_BAVAIL]
@@ -375,7 +375,7 @@
             used_f = myformat(used, sizeformat, fs_blocksize)
             avail_f = myformat(avail, sizeformat, fs_blocksize)
             try:
-                perc = round(100.*used/size, 1)
+                perc = round(100.*used/(avail+used), 1)
                 perc_f = str(perc)
             except ZeroDivisionError:
                 perc = 0
@@ -444,7 +444,7 @@
     "test if fs (as type) is a special one"
     "in addition, a filesystem is special if it has number of blocks equal to 0"
     fs = fs.lower()
-    return fs in [ "tmpfs", "devpts", "proc", "sysfs", "usbfs" ]
+    return fs in [ "tmpfs", "devpts", "proc", "sysfs", "usbfs", "procfs", "devfs" ]



