pydf is all-singing, all-dancing, fully colourised df(1)-clone

written in python.

WWW: http://kassiopeia.juls.savba.sk/~garabik/software/pydf/

PR:		ports/118451
Submitted by:	Baptiste Grenier <gwarf@gwarf.org>
This commit is contained in:
Pav Lucistnik 2007-12-14 16:54:24 +00:00
parent d644ec35d1
commit 1123329b7c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=203561
6 changed files with 107 additions and 0 deletions

View file

@ -538,6 +538,7 @@
SUBDIR += pwgen2 SUBDIR += pwgen2
SUBDIR += pwsafe SUBDIR += pwsafe
SUBDIR += py-bcfg2 SUBDIR += py-bcfg2
SUBDIR += pydf
SUBDIR += pyrenamer SUBDIR += pyrenamer
SUBDIR += qlogtools SUBDIR += qlogtools
SUBDIR += qpxtool SUBDIR += qpxtool

44
sysutils/pydf/Makefile Normal file
View file

@ -0,0 +1,44 @@
# New ports collection makefile for: pydf
# Date created: 29 November 2007
# Whom: Baptiste Grenier <gwarf@gwarf.org>
#
# $FreeBSD$
#
PORTNAME= pydf
PORTVERSION= 5
CATEGORIES= sysutils
MASTER_SITES= http://kassiopeia.juls.savba.sk/~garabik/software/pydf/
DISTNAME= pydf_5
MAINTAINER= gwarf@gwarf.org
COMMENT= A python implementation of df
SUB_FILES= pkg-message
PLIST_FILES= bin/pydf etc/pydfrc.sample
USE_PYTHON= true
NO_BUILD= yes
MAN1= pydf.1
MANCOMPRESSED= no
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
post-patch:
@${REINPLACE_CMD} -e 's|%%PYTHON_CMD%%|${PYTHON_CMD}| ; s|%%PREFIX%%|${PREFIX}|' ${WRKSRC}/pydf
do-install:
${INSTALL_SCRIPT} ${WRKSRC}/pydf ${PREFIX}/bin
${INSTALL_DATA} ${WRKSRC}/pydfrc ${PREFIX}/etc/pydfrc.sample
${INSTALL_MAN} ${WRKSRC}/pydf.1 ${PREFIX}/man/man1
post-install:
@if [ ! -f ${PREFIX}/etc/pydfrc ]; then \
${ECHO_MSG} ; \
${CAT} ${PKGMESSAGE} ; \
${ECHO_MSG} ; \
fi
.include <bsd.port.mk>

3
sysutils/pydf/distinfo Normal file
View file

@ -0,0 +1,3 @@
MD5 (pydf_5.tar.gz) = d429dbf726e29ace398980fc8b80eb30
SHA256 (pydf_5.tar.gz) = d9a845ce7f0f446fb3a426e7b9c6c7b6ea333e740dc558d132f814257e5d1d43
SIZE (pydf_5.tar.gz) = 11901

View file

@ -0,0 +1,47 @@
--- pydf.original Tue Dec 4 23:02:26 2007
+++ pydf Tue Dec 4 23:02:14 2007
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#! %%PYTHON_CMD%%
import sys, os, string, types, commands, struct
from optparse import OptionParser
@@ -166,7 +166,7 @@
#end of default definitions
# read configuration file
-for i in ["/etc/pydfrc", os.environ['HOME']+"/.pydfrc"]:
+for i in ["%%PREFIX%%/etc/pydfrc", os.environ['HOME']+"/.pydfrc"]:
if os.path.isfile(i):
execfile(i)
@@ -336,9 +336,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]
used = long(status[F_BLOCKS]-free)
size = status[F_BLOCKS]
@@ -351,7 +351,7 @@
avail_f = myformat(avail, sizeformat, fs_blocksize)
try:
- perc = round(100.*used/size, 1)
+ perc = round(100.*used/(avail+used), 1)
except ZeroDivisionError:
perc = 0
perc_f = str(perc)
@@ -419,7 +419,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" ]

View file

@ -0,0 +1,8 @@
=========================================================
Please copy the file %%PREFIX%%/etc/pydfrc.sample
to %%PREFIX%%/etc/pydfrc and edit your configuration.
=========================================================

4
sysutils/pydf/pkg-descr Normal file
View file

@ -0,0 +1,4 @@
pydf is all-singing, all-dancing, fully colourised df(1)-clone
written in python.
WWW: http://kassiopeia.juls.savba.sk/~garabik/software/pydf/