>Submitter-Id: current-users >Originator: David Vidal Rodríguez >Confidential: no >Synopsis: New port: xdf, show the free space of mounted partitions in X >Priority: low >Category: ports >Release: FreeBSD 4.7-STABLE i386 >Environment: System: FreeBSD host.domain 4.7-STABLE FreeBSD 4.7-STABLE #17: Wed Nov 13 12:05:13 CET 2002 root@host.domain:/usr/src/sys/compile/KERNEL i386 >Description: This is a port of xdf, a rather old X-client which shows the usage of mounted filesystems. It makes use of a graphical bar to show the percentage of use space, and values are displayed in human-readable form (K, M, G, T,...). >Fix: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # misc/xdf # misc/xdf/files # misc/xdf/files/patch-aa-xdf # misc/xdf/pkg-comment # misc/xdf/Makefile # misc/xdf/pkg-descr # misc/xdf/pkg-plist # misc/xdf/distinfo # echo c - misc/xdf mkdir -p misc/xdf > /dev/null 2>&1 echo c - misc/xdf/files mkdir -p misc/xdf/files > /dev/null 2>&1 echo x - misc/xdf/files/patch-aa-xdf sed 's/^X//' >misc/xdf/files/patch-aa-xdf << 'END-of-misc/xdf/files/patch-aa-xdf' X--- xdf.cc Mon Dec 22 10:57:27 1997 X+++ ../xdf/xdf.cc Sat Nov 9 02:10:11 2002 X@@ -18,18 +18,18 @@ X #include <stdio.h> X #include <iostream.h> X #include <strstream.h> X-#include <syscall.h> X+#include <sys/syscall.h> X #include <sys/param.h> X #include <sys/types.h> X-#include <sys/vfs.h> X+// #include <sys/vfs.h> X #include <unistd.h> X #include <ctype.h> X #include <pwd.h> X #include <stdlib.h> X #include <assert.h> X-#include <mntent.h> X+//#include <mntent.h> X #include <sys/mount.h> X-#include <linux/fs.h> X+#include <fstab.h> X X #include "config.H" X #include "xdf.H" X@@ -74,17 +74,21 @@ X /*{{{ Get Information and create Panel */ X int row = 0; X X- fstab = setmntent( "/etc/fstab", "r"); X+ if (! setfsent()) { X+ perror("Couldn't open /etc/fstab!\n"); X+ return 255; X+ } X X mountpoints=0; X- while ( table = getmntent( fstab ) ) { X- if ( strcmp( "swap", table->mnt_dir) && strcmp( "/proc", table->mnt_dir) X- && ( strcmp( "nfs", table->mnt_type ) || ( ! no_nfs ) ) X- && ( strcmp( "iso9660", table->mnt_type ) || ( ! no_iso9660 ) ) X+ fstab = getfsent(); X+ while ( fstab ) { X+ if ( strcmp( "swap", fstab->fs_file) && strcmp( "/proc", fstab->fs_file) X+ && ( strcmp( "nfs", fstab->fs_vfstype ) || ( ! no_nfs ) ) X+ && ( strcmp( "cd9660", fstab->fs_vfstype ) || ( ! no_iso9660 ) ) X ){ X par_table[mountpoints] = new Partition; X- par_table[mountpoints]->name = new char[ strlen(table->mnt_dir) + 1 ]; X- strcpy(par_table[mountpoints]->name, table->mnt_dir); X+ par_table[mountpoints]->name = new char[ strlen(fstab->fs_file) + 1 ]; X+ strcpy(par_table[mountpoints]->name, fstab->fs_file); X statfs(par_table[mountpoints]->name, &stat_buffer); X par_table[mountpoints]->last_max_value = X par_table[mountpoints]->max_value = ((double)stat_buffer.f_blocks * (double)stat_buffer.f_bsize) / (double) 1024; X@@ -97,8 +101,9 @@ X par_table[mountpoints]->last_value = -1; X mountpoints++; X } X+ fstab = getfsent(); X } X- endmntent( fstab ); X+ endfsent(); X X /*{{{ Title strings */ X X@@ -230,13 +235,13 @@ X par_table[i]->status = TRUE; X } X X- mtab = setmntent( "/etc/mtab", "r"); X- while ( table = getmntent( mtab ) ){ X- for ( int i = 0 ; i < mountpoints ; ++i ){ X- if ( !strcmp(par_table[i]->name, table->mnt_dir) ) par_table[i]->status = FALSE; X+ mntcount = getmntinfo(&mtab, 0); X+ for (int i = 0; i < mntcount; i++) { X+ for (int j = 0; j < mountpoints; j++) { X+ table = &mtab[i]; X+ if (! strcmp(par_table[j]->name, table->f_mntonname)) par_table[j]->status = FALSE; X } X } X- endmntent( mtab ); X X for ( int i = 0 ; i < mountpoints ; ++i ){ X if ( par_table[i]->status == FALSE && par_table[i]->last_status == TRUE) { X--- Makefile Fri Nov 28 18:43:45 1997 X+++ ../xdf/Makefile Sat Nov 9 15:32:13 2002 X@@ -7,9 +7,7 @@ X # on Linux systems "make ; make install" (run as superuser) should do everything X # X X- X-CCFLAGS = -m486 -O2 X-CPPFLAGS += $(CCFLAGS) -I /usr/openwin/include -I/usr/lib/g++-include -DMAIN X+CPPFLAGS += $(CCFLAGS) -I/usr/include -I/usr/local/include -I/usr/X11R6/include -I/usr/lib/g++-include -DMAIN X LDFLAGS += -L /usr/openwin/lib -L /usr/X11R6/lib X LDLIBS += -lxview -lX11 -lolgx X X@@ -17,7 +15,7 @@ X X PROGRAM = xdf X SOURCES.cc = xdf.cc X-INSTALLPATH = /usr/local/bin X+INSTALLPATH = /usr/X11R6/bin X SOURCES.h = X SOURCES.c = X SOURCES.G = X--- xdf.H Mon Dec 22 00:10:05 1997 X+++ ../xdf/xdf.H Fri Nov 8 21:17:34 2002 X@@ -51,14 +51,14 @@ X X /*{{{ Variables */ X char* prgname; X-FILE* fstab; X-FILE* mtab; X-struct mntent* table; X+struct fstab* fstab; X+struct statfs* mtab; X+struct statfs* table; X struct statfs stat_buffer; X int mountpoints; X Partition* par_table[50]; X struct itimerval timer; X- X+int mntcount; X X #ifdef NO_ISO9660 X int no_iso9660 = TRUE; END-of-misc/xdf/files/patch-aa-xdf echo x - misc/xdf/pkg-comment sed 's/^X//' >misc/xdf/pkg-comment << 'END-of-misc/xdf/pkg-comment' XA graphical disk space viewer for X END-of-misc/xdf/pkg-comment echo x - misc/xdf/Makefile sed 's/^X//' >misc/xdf/Makefile << 'END-of-misc/xdf/Makefile' X# New ports collection makefile for: xdf X# Date created: 9 November 2002 X# Whom: David Vidal-Rodriguez X# X# $FreeBSD$ X# X XPORTNAME= xdf XPORTVERSION= 1.3 XCATEGORIES= misc XMASTER_SITES= http://home.in.tum.de/~vidalrod/ports/ X XMAINTAINER= vidalrod@in.tum.de X XLIB_DEPENDS= xview.3:${PORTSDIR}/x11-toolkits/xview X XUSE_XLIB= yes XUSE_X_PREFIX= yes XUSE_GMAKE= yes X Xpost-install: X strip ${PREFIX}/bin/xdf X X.include <bsd.port.mk> END-of-misc/xdf/Makefile echo x - misc/xdf/pkg-descr sed 's/^X//' >misc/xdf/pkg-descr << 'END-of-misc/xdf/pkg-descr' XThis is a port of xdf, a rather old program which shows Xthe usage of mounted filesystems. It makes use of a graphical Xbar to show the percentage of use space, and values are displayed Xin human-readable form (K, M, G, T,...) XSee xdf -? for help. X X- David Vidal-Rodriguez Xvidalrod@in.tum.de END-of-misc/xdf/pkg-descr echo x - misc/xdf/pkg-plist sed 's/^X//' >misc/xdf/pkg-plist << 'END-of-misc/xdf/pkg-plist' Xbin/xdf END-of-misc/xdf/pkg-plist echo x - misc/xdf/distinfo sed 's/^X//' >misc/xdf/distinfo << 'END-of-misc/xdf/distinfo' XMD5 (xdf-1.3.tar.gz) = 14cb702a28058c9e25c7daf34a36a09c END-of-misc/xdf/distinfo exit
Responsible Changed From-To: gnats-admin->freebsd-ports Misfiled PR
State Changed From-To: open->closed Commited. Can you please check if the output of xdf is correctly?